diff --git a/src/tabs/index.ts b/src/tabs/index.ts index 10ede91e701..3beb7c17e93 100644 --- a/src/tabs/index.ts +++ b/src/tabs/index.ts @@ -2,6 +2,6 @@ export type { TabsInst } from './src/interface' export { default as NTab, tabProps } from './src/Tab' export type { TabProps } from './src/Tab' export { default as NTabPane, tabPaneProps } from './src/TabPane' -export type { TabPaneProps } from './src/TabPane' +export type { TabPaneProps, TabPaneSlots } from './src/TabPane' export { default as NTabs, tabsProps } from './src/Tabs' -export type { TabsProps } from './src/Tabs' +export type { TabsProps, TabsSlots } from './src/Tabs' diff --git a/src/tabs/src/TabPane.tsx b/src/tabs/src/TabPane.tsx index ecee6123110..9bdeec529b2 100644 --- a/src/tabs/src/TabPane.tsx +++ b/src/tabs/src/TabPane.tsx @@ -5,6 +5,7 @@ import { type HTMLAttributes, inject, type PropType, + type SlotsType, type VNode, type VNodeChild, watchEffect @@ -38,11 +39,18 @@ export const tabPaneProps = { export type TabPaneProps = ExtractPublicPropTypes +export interface TabPaneSlots { + default?: any + prefix?: any + suffix?: any +} + export default defineComponent({ __TAB_PANE__: true, name: 'TabPane', alias: ['TabPanel'], props: tabPaneProps, + slots: Object as SlotsType, setup(props) { if (__DEV__) { watchEffect(() => { diff --git a/src/tabs/src/Tabs.tsx b/src/tabs/src/Tabs.tsx index 9555779e155..643f07de4c3 100644 --- a/src/tabs/src/Tabs.tsx +++ b/src/tabs/src/Tabs.tsx @@ -28,6 +28,7 @@ import { type PropType, provide, ref, + type SlotsType, toRef, TransitionGroup, type VNode, @@ -114,9 +115,16 @@ export const tabsProps = { export type TabsProps = ExtractPublicPropTypes +export interface TabsSlots { + default?: any + prefix?: any + suffix?: any +} + export default defineComponent({ name: 'Tabs', props: tabsProps, + slots: Object as SlotsType, setup(props, { slots }) { if (__DEV__) { watchEffect(() => {