mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
* fix(components): [tabs] ensure label slot updates * fix: compatible with Vue 3.4+ * chore: comments
37 lines
914 B
TypeScript
37 lines
914 B
TypeScript
import type {
|
|
ComputedRef,
|
|
InjectionKey,
|
|
Ref,
|
|
Slots,
|
|
UnwrapRef,
|
|
VNode,
|
|
} from 'vue'
|
|
import type { TabsProps } from './tabs'
|
|
import type { TabPaneProps } from './tab-pane'
|
|
import type { TabNavInstance } from './tab-nav'
|
|
|
|
export type TabPaneName = string | number
|
|
|
|
export type TabsPaneContext = UnwrapRef<{
|
|
uid: number
|
|
getVnode: () => VNode
|
|
slots: Slots
|
|
props: TabPaneProps
|
|
paneName: ComputedRef<TabPaneName | undefined>
|
|
active: ComputedRef<boolean>
|
|
index: Ref<string | undefined>
|
|
isClosable: ComputedRef<boolean>
|
|
isFocusInsidePane: () => boolean | undefined
|
|
}>
|
|
|
|
export interface TabsRootContext {
|
|
props: TabsProps
|
|
currentName: Ref<TabPaneName>
|
|
registerPane: (pane: TabsPaneContext) => void
|
|
unregisterPane: (pane: TabsPaneContext) => void
|
|
nav$: Ref<TabNavInstance | undefined>
|
|
}
|
|
|
|
export const tabsRootContextKey: InjectionKey<TabsRootContext> =
|
|
Symbol('tabsRootContextKey')
|