// types
const props = defineProps<{
icon: string
size?: string | number
cursor?: boolean
prefix?: string
}>()
// types
const props = defineProps<{
icon: string
size?: string | number
cursor?: boolean
prefix?: string
}>()
// 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'])
// 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'])
// 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'])
// 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'])
// types
const props = withDefaults(defineProps<{
modelValue?: string
placeholder?: string
auto?: boolean
delay?: number
}>(), {
placeholder: '关键词',
auto: true,
delay: 300
})
const emit = defineEmits(['search', 'update:modelValue'])
// 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'])
// 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'])
// 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'])
// 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'])
// 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'])
// types
const props = defineProps<{
text: string
width?: string | number
position?: 'left' | 'right' | 'bottom'
}>()
// 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'])
// 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, Number | 无 | 120,313 | true | |
effect | 是否特效模式 | Boolean | 无 | 92,381,234.3234 | false | |
type | input的type值 | String | 无 | 120,313 | true | |
name | input的name值 | String | 无 | 120,313 | true | |
placeholder | input的placeholder值 | String | 无 | 120,313 | true | |
required | input的required值 | Boolean | 无 | 120,313 | true | |
pattern | input的pattern值 | String | 无 | 120,313 | true | |
disabled | 是否禁用 | Boolean | 无 | 120,313 | true | |
step | number类型的input的step值 | String | 无 | 923,812.343234 | false | |
min | number类型的input的min值 | String, Number | 无 | 9,238.123432 | false |
属性 | 说明 | 类型 | 默认值 | 价值 | 是否选中 |
---|---|---|---|---|---|
v-model | 组件双向绑定的值 | String, Number | 无 | 120,313 | true |
effect | 是否特效模式 | Boolean | 无 | 92,381,234.3234 | false |
type | input的type值 | String | 无 | 120,313 | true |
name | input的name值 | String | 无 | 120,313 | true |
placeholder | input的placeholder值 | String | 无 | 120,313 | true |
required | input的required值 | Boolean | 无 | 120,313 | true |
pattern | input的pattern值 | String | 无 | 120,313 | true |
disabled | 是否禁用 | Boolean | 无 | 120,313 | true |
step | number类型的input的step值 | String | 无 | 923,812.343234 | false |
min | number类型的input的min值 | String, Number | 无 | 9,238.123432 | false |
max | number类型的input的max值 | String, Number | 无 | 923,812,343,234 | false |
minlength | input的minlength值 | String, Number | 无 | 9,238,123,432.34 | false |
maxlength | input的minlength值 | String, Number | 无 | 9,238,123.43234 | false |
focus | 是否自动获得焦点 | Boolean | 无 | 923,812,343,234 | false |
resize | 是否自动调整宽度 | Boolean | 无 | 923,812,343,234 | false |
readonly | input的readonly值 | Boolean | 无 | 92,381,234,323.4 | false |
@enter | 按回车时触发该事件 | Function | 无 | 923,812,343,234 | false |
属性 | 说明 | 类型 | 默认值 | 价值 | 是否选中 | |
---|---|---|---|---|---|---|
v-model | 组件双向绑定的值 | String, Number | 无 | 120,313 | true | |
effect | 是否特效模式 | Boolean | 无 | 92,381,234.3234 | false | |
type | input的type值 | String | 无 | 120,313 | true | |
name | input的name值 | String | 无 | 120,313 | true | |
placeholder | input的placeholder值 | String | 无 | 120,313 | true | |
required | input的required值 | Boolean | 无 | 120,313 | true | |
pattern | input的pattern值 | String | 无 | 120,313 | true | |
disabled | 是否禁用 | Boolean | 无 | 120,313 | true | |
step | number类型的input的step值 | String | 无 | 923,812.343234 | false | |
min | number类型的input的min值 | String, Number | 无 | 9,238.123432 | false | |
max | number类型的input的max值 | String, Number | 无 | 923,812,343,234 | false | |
minlength | input的minlength值 | String, Number | 无 | 9,238,123,432.34 | false | |
maxlength | input的minlength值 | String, Number | 无 | 9,238,123.43234 | false | |
focus | 是否自动获得焦点 | Boolean | 无 | 923,812,343,234 | false | |
resize | 是否自动调整宽度 | Boolean | 无 | 923,812,343,234 | false | |
readonly | input的readonly值 | Boolean | 无 | 92,381,234,323.4 | false | |
@enter | 按回车时触发该事件 | Function | 无 | 923,812,343,234 | false |
// 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
})
// 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'])
// types
const props = defineProps<{
count?: string | number
color?: string
}>()
// types
export interface StepItem {
text?: string
icon?: string
}
const props = defineProps<{
items: StepItem[]
cur: number
}>()