@tplc/wot
Version:
120 lines (119 loc) • 2.45 kB
TypeScript
import type { ComponentPublicInstance, ExtractPropTypes, PropType } from 'vue'
export type DropMenuItemBeforeToggleOption = {
status: boolean
resolve: (isPass: boolean) => void
}
export type DropMenuItemBeforeToggle = (option: DropMenuItemBeforeToggleOption) => void
export declare const dorpMenuItemProps: {
/**
* DropMenuItem 左侧文字样式
*/
customTitle: {
type: PropType<string>
default: string
}
/**
* DropMenuItem 右侧 icon 样式
*/
customIcon: {
type: PropType<string>
default: string
}
/**
* 当前选中项对应选中的 value
*/
modelValue: (NumberConstructor | StringConstructor)[]
/**
* 列表数据,对应数据结构 [{text: '标题', value: '0', tip: '提示文字'}]
*/
options: {
type: PropType<Record<string, any>[]>
default: () => never[]
}
/**
* 禁用菜单
*/
disabled: {
type: BooleanConstructor
default: boolean
}
/**
* 选中的图标名称(可选名称在 wd-icon 组件中)
*/
iconName: {
type: PropType<string>
default: string
}
/**
* 菜单标题
*/
title: StringConstructor
/**
* 菜单图标
*/
icon: {
type: PropType<string>
default: string
}
/**
* 菜单图标大小
*/
iconSize: {
type: PropType<string>
default: string
}
/**
* 自定义点击事件
*/
beforeToggle: PropType<DropMenuItemBeforeToggle>
/**
* 选项对象中,value 对应的 key
*/
valueKey: {
type: PropType<string>
default: string
}
/**
* 选项对象中,展示的文本对应的 key
*/
labelKey: {
type: PropType<string>
default: string
}
/**
* 选项对象中,选项说明对应的 key
*/
tipKey: {
type: PropType<string>
default: string
}
selected: {
type: BooleanConstructor
default: boolean
}
/**
* 选项对象中,选项说明对应的 key
*/
dot: {
type: NumberConstructor
default: number
}
customStyle: {
type: PropType<string>
default: string
}
customClass: {
type: PropType<string>
default: string
}
}
export type DropMenuItemProps = ExtractPropTypes<typeof dorpMenuItemProps>
export type DropMenuItemExpose = {
getShowPop: () => boolean
open: () => void
close: () => void
toggle: () => void
getSelected: () => boolean
getDot: () => number
}
export type DropMenuItemInstance = ComponentPublicInstance<DropMenuItemProps>