From 6fd2272fe652877808c893582e26dfeb8e8d41b7 Mon Sep 17 00:00:00 2001 From: Naily Date: Sat, 7 Dec 2024 23:58:05 +0800 Subject: [PATCH] feat(result): add slots type (#6599) --- src/result/index.ts | 2 +- src/result/src/Result.tsx | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/result/index.ts b/src/result/index.ts index 4d1459f93e1..124983f5d5e 100644 --- a/src/result/index.ts +++ b/src/result/index.ts @@ -1,2 +1,2 @@ export { default as NResult, resultProps } from './src/Result' -export type { ResultProps } from './src/Result' +export type { ResultProps, ResultSlots } from './src/Result' diff --git a/src/result/src/Result.tsx b/src/result/src/Result.tsx index 7d4bbd507ff..df8679ddab9 100644 --- a/src/result/src/Result.tsx +++ b/src/result/src/Result.tsx @@ -6,7 +6,8 @@ import { type CSSProperties, defineComponent, h, - type PropType + type PropType, + type SlotsType } from 'vue' import { NBaseIcon } from '../../_internal' import { @@ -53,9 +54,16 @@ export const resultProps = { export type ResultProps = ExtractPublicPropTypes +export interface ResultSlots { + default?: any + footer?: any + icon?: any +} + export default defineComponent({ name: 'Result', props: resultProps, + slots: Object as SlotsType, setup(props) { const { mergedClsPrefixRef, inlineThemeDisabled } = useConfig(props) const themeRef = useTheme(