EASYAIuniappNewUI/node_modules/@tuniao/tnui-vue3-uniapp/components/tabs/src/tabs-item.ts
2025-02-08 18:50:38 +08:00

48 lines
979 B
TypeScript

import { buildProps, definePropType } from '../../../utils'
import { tabsBaseProps } from '../../base/common-props/tabs'
import type { ExtractPropTypes } from 'vue'
import type { BadgeProps } from '../../badge'
export type TabsItemBadgeConfig = Partial<Pick<BadgeProps, 'dot'>> & {
value?: string | number
}
export const tabsItemProps = buildProps({
...tabsBaseProps,
/**
* @description 唯一标识
*/
name: {
type: [String, Number],
},
/**
* @description 标题
*/
title: {
type: String,
required: true,
},
/**
* @description 角标配置
*/
badgeConfig: {
type: definePropType<TabsItemBadgeConfig>(Object),
default: () => ({}),
},
/**
* @description 是否禁用
*/
disabled: Boolean,
})
export const tabsItemEmits = {
/**
* @description 点击事件
*/
click: () => true,
}
export type TabsItemProps = ExtractPropTypes<typeof tabsItemProps>
export type TabsItemEmits = typeof tabsItemEmits