element-plus/packages/tokens/tabs.ts

23 lines
680 B
TypeScript
Raw Normal View History

import type { TabPaneProps, TabsProps } from '@element-plus/components/tabs'
import type { ComputedRef, InjectionKey, Ref, Slots, UnwrapRef } from 'vue'
2021-11-12 05:38:50 +08:00
export type TabsPaneContext = UnwrapRef<{
uid: number
slots: Slots
2021-11-12 05:38:50 +08:00
props: TabPaneProps
paneName: ComputedRef<string | number | undefined>
2021-11-12 05:38:50 +08:00
active: ComputedRef<boolean>
index: Ref<string | undefined>
isClosable: ComputedRef<boolean>
}>
export interface TabsRootContext {
props: TabsProps
currentName: Ref<string | number>
registerPane: (pane: TabsPaneContext) => void
unregisterPane: (uid: number) => void
2021-11-12 05:38:50 +08:00
}
export const tabsRootContextKey: InjectionKey<TabsRootContext> =
Symbol('tabsRootContextKey')