wot-design-uni
Version:
一个基于Vue3+TS开发的uni-app组件库,提供70+高质量组件,支持暗黑模式、国际化和自定义主题。
32 lines (29 loc) • 931 B
text/typescript
import type { ExtractPropTypes, Prop, PropType } from 'vue'
import { baseProps, makeBooleanProp, makeNumberProp, makeRequiredProp } from '../common/props'
import type { BadgeProps } from '../wd-badge/types'
export const sidebarItemProps = {
...baseProps,
/** 当前选项标题 */
label: makeRequiredProp(String),
/** 当前选项的值,唯一标识 */
value: makeRequiredProp([Number, String]),
/** 徽标显示值 */
badge: {
type: [String, Number, null] as PropType<string | number | null>,
default: null
},
/** 徽标属性,透传给 Badge 组件 */
badgeProps: Object as PropType<Partial<BadgeProps>>,
/** 图标 */
icon: String,
/** 是否点状徽标 */
isDot: {
type: Boolean,
default: undefined
},
/** 徽标最大值 */
max: Number,
/** 是否禁用 */
disabled: makeBooleanProp(false)
}
export type SidebarItemProps = ExtractPropTypes<typeof sidebarItemProps>