From 90624f1dbc57c7bde6fa02b1d937b51fdda8f476 Mon Sep 17 00:00:00 2001 From: Naily Date: Sun, 8 Dec 2024 00:19:17 +0800 Subject: [PATCH] feat(tooltip): export slots type (#6599) --- src/tooltip/index.ts | 2 +- src/tooltip/src/Tooltip.ts | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/tooltip/index.ts b/src/tooltip/index.ts index f85129fccf7..010be3d1cb2 100644 --- a/src/tooltip/index.ts +++ b/src/tooltip/index.ts @@ -1,2 +1,2 @@ export { default as NTooltip, tooltipProps } from './src/Tooltip' -export type { TooltipInst, TooltipProps } from './src/Tooltip' +export type { TooltipInst, TooltipProps, TooltipSlots } from './src/Tooltip' diff --git a/src/tooltip/src/Tooltip.ts b/src/tooltip/src/Tooltip.ts index 86eeaf78e2c..b5e0f437ad5 100644 --- a/src/tooltip/src/Tooltip.ts +++ b/src/tooltip/src/Tooltip.ts @@ -1,9 +1,9 @@ import type { ThemeProps } from '../../_mixins' import type { ExtractPublicPropTypes } from '../../_utils' -import type { PopoverInst } from '../../popover' +import type { PopoverInst, PopoverSlots } from '../../popover' import type { TooltipTheme } from '../styles' // Tooltip: popover wearing waistcoat -import { computed, defineComponent, h, ref } from 'vue' +import { computed, defineComponent, h, ref, type SlotsType } from 'vue' import { useConfig, useTheme } from '../../_mixins' import { NPopover } from '../../popover' import { popoverBaseProps } from '../../popover/src/Popover' @@ -18,9 +18,12 @@ export const tooltipProps = { export type TooltipProps = ExtractPublicPropTypes +export interface TooltipSlots extends PopoverSlots {} + export default defineComponent({ name: 'Tooltip', props: tooltipProps, + slots: Object as SlotsType, __popover__: true, setup(props) { const { mergedClsPrefixRef } = useConfig(props)