2024-11-05 10:07:40 +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')