zgg-ui
Version:
2.0.1 正式版本 基于 Vue 3、UniApp 和 TypeScript 开发的多端适配移动端 UI 组件库,旨在提供丰富的组件集合,帮助开发者快速构建多端响应式的移动应用界面
43 lines (37 loc) • 1.01 kB
text/typescript
import type { InjectionKey } from 'vue'
import { PropsTypeHook } from '../../libs/zHooks'
interface PropsType extends PropsTypeHook {
value?: string | number
safeAreaInsetBottom?: boolean
border?: boolean
height?: string | number
zIndex?: number
bgColor?: string
hasBulgeButton?: boolean
switchAnimation?: boolean
frosted?: boolean
activeColor?: string
inactiveColor?: string
fixed?: boolean
placeholder?: boolean
}
interface TabbarItemRect {
width: number
height: number
left: number
maxWidth?: number
}
export type TabbarItemContext = {
uid: number
name?: string | number
}
export type TabbarContext = PropsType & {
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')