nutui-uniapp
Version:
京东风格的轻量级移动端 Uniapp、Vue3 组件库(支持小程序开发)
30 lines (23 loc) • 742 B
text/typescript
import type { ExtractPropTypes } from 'vue'
import { CHANGE_EVENT } from '../_constants'
import { commonProps, isNumber, makeArrayProp, makeStringProp } from '../_utils'
export interface CategoryType {
catName?: string
[key: string]: any
}
export const categoryProps = {
...commonProps,
/**
* @description 分类模式:`classify`,`text`,`custom`
*/
type: makeStringProp<'classify' | 'text' | 'custom'>('classify'),
/**
* @description 左侧导航栏数据列表
*/
category: makeArrayProp<any>([]),
}
export type CategoryProps = ExtractPropTypes<typeof categoryProps>
export const categoryEmits = {
[CHANGE_EVENT]: (index: number) => isNumber(index),
}
export type CategoryEmits = typeof categoryEmits