LvIcon
Icons Preview
// types
const props = defineProps<{
  icon: string
  size?: string | number
  cursor?: boolean
  prefix?: string
}>()
      
LvButton
// types
type ButtonType = 'button' | 'submit' | 'reset'

const props = defineProps<{
  type?: ButtonType
  theme?: 'primary' | 'danger' | 'ghost' | 'text'
  size?: 'lg' | 'sm'
  disabled?: boolean
  icon?: string
  loading?: boolean
  submit?: boolean
}>()
const emit = defineEmits(['click'])
      
LvDropdown
// types
export interface DropdownItem {
  type?: 'link' | 'divider'
  icon?: string
  text?: string
  url?: string
}

defineProps<{
  title?: string
  icon?: string
  align?: 'right' | 'bottom' | 'bottom-right'
  items: DropdownItem[]
}>()
const emit = defineEmits(['clickItem'])
      
左对齐
个人中心修改密码
退出登录
右对齐
个人中心修改密码
退出登录
底部对齐
个人中心修改密码
退出登录
底部右对齐
个人中心修改密码
退出登录
Custom Trigger
个人中心修改密码
退出登录
LvInput
// types
const props = defineProps<{
  modelValue?: string | number | null
  label?: string
  type?: 'text' | 'number' | 'email' | 'password' | 'search' | 'tel' | 'url'
  name?: string
  placeholder?: string
  pattern?: string
  required?: boolean
  disabled?: boolean
  focus?: boolean
  resize?: boolean
  readonly?: boolean
  vertical?: boolean
  step?: number
  min?: number
  max?: number
  minlength?: number
  maxlength?: number
}>()
const emit = defineEmits(['update:modelValue', 'enter', 'blur'])
      
LvOptions
// types
export interface OptionItem {
  text: string
  value: number | string | null
  disabled?: boolean
}

const props = defineProps<{
  type: 'radio' | 'checkbox' | 'switch'
  modelValue: number | string | boolean | []
  items: OptionItem[]
  name?: string,
  reverse?: boolean
  vertical?: boolean
  shape?: 'button'
}>()
const emit = defineEmits(['update:modelValue'])
      
vue
300
[ "vue", "react" ]
[ 100, 300 ]
true
true
LvSearch
// types
const props = withDefaults(defineProps<{
  modelValue?: string
  placeholder?: string
  auto?: boolean
  delay?: number
}>(), {
  placeholder: '关键词',
  auto: true,
  delay: 300
})
const emit = defineEmits(['search', 'update:modelValue'])
      
LvUpload
// types
const props = withDefaults(defineProps<{
  name?: string
  auto?: boolean
  multi?: boolean
  required?: boolean
  showThumbnail?: boolean
  loading?: boolean
  thumbSize?: number
  accept?: string
  text?: string
  shape?: 'button' | 'square'
}>(), {
  thumbSize: 100,
  text: '选择文件',
  shape: 'button'
})
const emit = defineEmits(['select'])
      
LvTabs
// types
export interface IconItem {
  text?: string
  icon?: string
}

type TabItem = IconItem | string | number

const props = defineProps<{
  modelValue: number
  items: TabItem[]
  locked?: boolean
}>()
const emit = defineEmits(['update:modelValue'])
      
Vue
React
Angular
Tesla
XiaoPeng
WeiLai
LvSelect
// types
export interface OptionItem {
  text: string
  value: number | string | null
  children?: OptionItem[]
  disabled?: boolean
}

const props = withDefaults(defineProps<{
  modelValue: string | number | [] | null
  items: OptionItem[]
  name?: string
  disabled?: boolean
  multiple?: boolean
  searchable?: boolean
  placeholder?: string
  searchPlaceholder?: string
  max?: number
  clearable?: boolean
  required?: boolean
}>(), {
  placeholder: '请选择',
  searchPlaceholder: '搜索',
})
const emit = defineEmits(['update:modelValue', 'selected-items'])
      
请选择
  • 布加迪
  • 法拉利
  • 兰博基尼
    • Aventador
    • Sesto Elemento
    • Veneno
    • Veneno Roadster
    • Urus
    • Huracan
    • Huracan EVO SpyderHuracan EVO SpyderHuracan EVO Spyder
    • Reventon
    • Gallardo
    • Murcielago
    • Diablo
    • Asterion
    • Estoque
  • 迈凯伦
法拉利
  • 布加迪
  • 法拉利
  • 兰博基尼
    • Aventador
    • Sesto Elemento
    • Veneno
    • Veneno Roadster
    • Urus
    • Huracan
    • Huracan EVO SpyderHuracan EVO SpyderHuracan EVO Spyder
    • Reventon
    • Gallardo
    • Murcielago
    • Diablo
    • Asterion
    • Estoque
  • 迈凯伦
兰博基尼
  • 布加迪
  • 法拉利
  • 兰博基尼
    • Aventador
    • Sesto Elemento
    • Veneno
    • Veneno Roadster
    • Urus
    • Huracan
    • Huracan EVO SpyderHuracan EVO SpyderHuracan EVO Spyder
    • Reventon
    • Gallardo
    • Murcielago
    • Diablo
    • Asterion
    • Estoque
  • 迈凯伦
Reventon
  • 布加迪
  • 法拉利
  • 兰博基尼
    • Aventador
    • Sesto Elemento
    • Veneno
    • Veneno Roadster
    • Urus
    • Huracan
    • Huracan EVO SpyderHuracan EVO SpyderHuracan EVO Spyder
    • Reventon
    • Gallardo
    • Murcielago
    • Diablo
    • Asterion
    • Estoque
  • 迈凯伦
布加迪
法拉利
  • 布加迪
  • 法拉利
  • 兰博基尼
    • Aventador
    • Sesto Elemento
    • Veneno
    • Veneno Roadster
    • Urus
    • Huracan
    • Huracan EVO SpyderHuracan EVO SpyderHuracan EVO Spyder
    • Reventon
    • Gallardo
    • Murcielago
    • Diablo
    • Asterion
    • Estoque
  • 迈凯伦
LvDialog
// types
export interface Props {
  modelValue?: boolean
  title?: string
  body?: string
  okText?: string
  cancelText?: string
  noFooter?: boolean
  simple?: boolean
  fixed?: boolean
  visible?: boolean
  class?: string
  confirm?: () => unknown // return false or throw error to not close the dialog.
}
const props = withDefaults(defineProps<Props>(), {
  okText: '确认',
  cancelText: '取消'
})
const emit = defineEmits(['update:modelValue'])
      
LvDatePicker
// types
interface Day {
  text: number
  month: number
}

const props = withDefaults(defineProps<{
  modelValue: string
  name?: string
  minYear?: number
  maxYear?: number
  weeksText?: string[]
  monthsText?: string[]
}>(), {
  minYear: 1950,
  maxYear: 2050,
  weeksText: () => ['日', '一', '二', '三', '四', '五', '六'],
  monthsText: () => ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
})
const emit = defineEmits(['update:modelValue'])
      
4月
2022
  • 1950
  • 1951
  • 1952
  • 1953
  • 1954
  • 1955
  • 1956
  • 1957
  • 1958
  • 1959
  • 1960
  • 1961
  • 1962
  • 1963
  • 1964
  • 1965
  • 1966
  • 1967
  • 1968
  • 1969
  • 1970
  • 1971
  • 1972
  • 1973
  • 1974
  • 1975
  • 1976
  • 1977
  • 1978
  • 1979
  • 1980
  • 1981
  • 1982
  • 1983
  • 1984
  • 1985
  • 1986
  • 1987
  • 1988
  • 1989
  • 1990
  • 1991
  • 1992
  • 1993
  • 1994
  • 1995
  • 1996
  • 1997
  • 1998
  • 1999
  • 2000
  • 2001
  • 2002
  • 2003
  • 2004
  • 2005
  • 2006
  • 2007
  • 2008
  • 2009
  • 2010
  • 2011
  • 2012
  • 2013
  • 2014
  • 2015
  • 2016
  • 2017
  • 2018
  • 2019
  • 2020
  • 2021
  • 2022
  • 2023
  • 2024
  • 2025
  • 2026
  • 2027
  • 2028
  • 2029
  • 2030
  • 2031
  • 2032
  • 2033
  • 2034
  • 2035
  • 2036
  • 2037
  • 2038
  • 2039
  • 2040
  • 2041
  • 2042
  • 2043
  • 2044
  • 2045
  • 2046
  • 2047
  • 2048
  • 2049
  • 2050
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
6月
请选择
  • 2020
  • 2021
  • 2022
  • 2023
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
10
11
12
LvTooltip
// types
const props = defineProps<{
  text: string
  width?: string | number
  position?: 'left' | 'right' | 'bottom'
}>()
      
提示在上面
LvPagination
// types
export interface Pagination {
  index: number
  pageSize: number
}

const props = withDefaults(defineProps<{
  total: number
  pageSize?: number
  sizeOptions?: number[]
  simple?: boolean
  theme?: 'ghost' | 'text'
}>(), {
  pageSize: 10,
  sizeOptions: () => [10, 20, 50],
  theme: 'ghost'
})
const emit = defineEmits(['update'])
      
共 100 条
每页
10
  • 10
  • 20
  • 50
前往
共 100 条
每页
10
  • 10
  • 20
  • 50
前往
1/10页
1/10页
LvTable
// types
interface Column {
  title?: string
  prop?: string
  sortable?: boolean
  cssClass?: string
  formatter?: 'thousands' | 'numberToBoolean' | (<T>(x: T) => T)
}

const props = withDefaults(defineProps<{
  rows: []
  columns: Column[]
  simple?: boolean
  simplePagination?: boolean
  fixedHead?: boolean
  checkbox?: boolean
  emptyText?: string
  total?: number
}>(), {
  emptyText: '暂无数据'
})
const emit = defineEmits(['click-row', 'checked'])
      
属性
说明
类型
默认值
价值
是否选中
v-model组件双向绑定的值String, Number120,313true
effect是否特效模式Boolean92,381,234.3234false
typeinput的type值String120,313true
nameinput的name值String120,313true
placeholderinput的placeholder值String120,313true
requiredinput的required值Boolean120,313true
patterninput的pattern值String120,313true
disabled是否禁用Boolean120,313true
stepnumber类型的input的step值String923,812.343234false
minnumber类型的input的min值String, Number9,238.123432false
属性
说明
类型
默认值
价值
是否选中
v-model组件双向绑定的值String, Number120,313true
effect是否特效模式Boolean92,381,234.3234false
typeinput的type值String120,313true
nameinput的name值String120,313true
placeholderinput的placeholder值String120,313true
requiredinput的required值Boolean120,313true
patterninput的pattern值String120,313true
disabled是否禁用Boolean120,313true
stepnumber类型的input的step值String923,812.343234false
minnumber类型的input的min值String, Number9,238.123432false
maxnumber类型的input的max值String, Number923,812,343,234false
minlengthinput的minlength值String, Number9,238,123,432.34false
maxlengthinput的minlength值String, Number9,238,123.43234false
focus是否自动获得焦点Boolean923,812,343,234false
resize是否自动调整宽度Boolean923,812,343,234false
readonlyinput的readonly值Boolean92,381,234,323.4false
@enter按回车时触发该事件Function923,812,343,234false
属性
说明
类型
默认值
价值
是否选中
v-model组件双向绑定的值String, Number120,313true
effect是否特效模式Boolean92,381,234.3234false
typeinput的type值String120,313true
nameinput的name值String120,313true
placeholderinput的placeholder值String120,313true
requiredinput的required值Boolean120,313true
patterninput的pattern值String120,313true
disabled是否禁用Boolean120,313true
stepnumber类型的input的step值String923,812.343234false
minnumber类型的input的min值String, Number9,238.123432false
maxnumber类型的input的max值String, Number923,812,343,234false
minlengthinput的minlength值String, Number9,238,123,432.34false
maxlengthinput的minlength值String, Number9,238,123.43234false
focus是否自动获得焦点Boolean923,812,343,234false
resize是否自动调整宽度Boolean923,812,343,234false
readonlyinput的readonly值Boolean92,381,234,323.4false
@enter按回车时触发该事件Function923,812,343,234false
Globals
// call
import { Indicator } from 'lovue'

Indicator.open()
Indicator.close()
      
// call
import { Dialog } from 'lovue'

Dialog({
  title: '标题',
  body: '内容',
  noFooter: true,
  simple: true,
  fixed: true,
  confirm: async () => {
    await sleep(2000)
    return true
  }
})
      
// call
import { Toast } from 'lovue'

Toast({
  text: 'hello world',
  type: 'success',
  showClose: true
})

Toast.success({
  text: 'hello world',
  showClose: true
})
      
LvMenu
// types
export type MenuMode = 'SPA' | 'link' | 'nonLink'
export interface Menu {
  title?: string
  icon?: string
  url?: string
  mode?: MenuMode
  children?: Menu[]
  _focus?: boolean
  _open?: boolean
  _openIcon?: boolean
}

const props = defineProps<{
  items: Menu[]
  vertical?: boolean
  mode?: MenuMode
}>()
const emit = defineEmits(['click-item'])
      
    LvBadge
    // types
    const props = defineProps<{
      count?: string | number
      color?: string
    }>()
          
    邮件
    20
    LvSteps
    // types
    export interface StepItem {
      text?: string
      icon?: string
    }
    
    const props = defineProps<{
      items: StepItem[]
      cur: number
    }>()
          
    第一步
    第二步
    第三步
    1第一步
    2第二步
    3第三步