element-plus/packages/tokens/tabs.ts

29 lines
733 B
TypeScript
Raw Normal View History

import type { TabPaneProps, TabsProps } from '@element-plus/components/tabs'
2021-11-12 05:38:50 +08:00
import type {
ComponentInternalInstance,
ComputedRef,
InjectionKey,
Ref,
2021-11-12 05:38:50 +08:00
ShallowReactive,
UnwrapRef,
2021-11-12 05:38:50 +08:00
} from 'vue'
export type TabsPaneContext = UnwrapRef<{
uid: number
instance: ShallowReactive<ComponentInternalInstance>
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>
2021-11-12 05:38:50 +08:00
updatePaneState: (pane: TabsPaneContext) => void
}
export const tabsRootContextKey: InjectionKey<TabsRootContext> =
Symbol('tabsRootContextKey')