EASYAIuniappNewUI/node_modules/@tuniao/tnui-vue3-uniapp/tokens/tabbar.ts
2025-02-08 18:50:38 +08:00

20 lines
544 B
TypeScript

import type { InjectionKey } from 'vue'
import type { TabbarItemRect, TabbarProps } from '../components/tabbar'
export type TabbarItemContext = {
uid: number
name?: string | number
}
export type TabbarContext = TabbarProps & {
items: TabbarItemContext[]
activeUid: number
addItem: (item: TabbarItemContext) => void
removeItem: (uid: number) => void
setActiveItem: (uid: number) => void
setBulgeCircle: (rect: TabbarItemRect) => void
}
export const tabbarContextKey: InjectionKey<TabbarContext> =
Symbol('tabbarContextKey')