From acdc030e56fbb3e33aeede4e58094b3ec734971c Mon Sep 17 00:00:00 2001 From: Naily Date: Sat, 7 Dec 2024 23:06:31 +0800 Subject: [PATCH] feat(empty): add slots type (#6599) --- src/empty/index.ts | 2 +- src/empty/src/Empty.tsx | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/empty/index.ts b/src/empty/index.ts index 57951868b68..29125269122 100644 --- a/src/empty/index.ts +++ b/src/empty/index.ts @@ -1,2 +1,2 @@ export { emptyProps, default as NEmpty } from './src/Empty' -export type { EmptyProps } from './src/Empty' +export type { EmptyProps, EmptySlots } from './src/Empty' diff --git a/src/empty/src/Empty.tsx b/src/empty/src/Empty.tsx index ca65c2c74fd..e7e301c24c0 100644 --- a/src/empty/src/Empty.tsx +++ b/src/empty/src/Empty.tsx @@ -6,6 +6,7 @@ import { defineComponent, h, type PropType, + type SlotsType, type VNodeChild } from 'vue' import { NBaseIcon } from '../../_internal/icon' @@ -35,9 +36,16 @@ export const emptyProps = { export type EmptyProps = ExtractPublicPropTypes +export interface EmptySlots { + default?: any + extra?: any + icon?: any +} + export default defineComponent({ name: 'Empty', props: emptyProps, + slots: Object as SlotsType, setup(props) { const { mergedClsPrefixRef, inlineThemeDisabled, mergedComponentPropsRef } = useConfig(props)