diff --git a/src/dialog/index.ts b/src/dialog/index.ts index a9acb1cbe92..4354d727557 100644 --- a/src/dialog/index.ts +++ b/src/dialog/index.ts @@ -1,5 +1,6 @@ export { useDialog, useDialogReactiveList } from './src/composables' export { NDialog } from './src/Dialog' +export type { DialogSlots } from './src/Dialog' export { dialogProps } from './src/dialogProps' export type { DialogProps } from './src/dialogProps' export { dialogProviderProps, NDialogProvider } from './src/DialogProvider' diff --git a/src/dialog/src/Dialog.tsx b/src/dialog/src/Dialog.tsx index 0a0e12ee9bc..7812bf68e46 100644 --- a/src/dialog/src/Dialog.tsx +++ b/src/dialog/src/Dialog.tsx @@ -1,7 +1,13 @@ import type { ThemeProps } from '../../_mixins' import type { DialogTheme } from '../styles' import { getMargin } from 'seemly' -import { computed, type CSSProperties, defineComponent, h } from 'vue' +import { + computed, + type CSSProperties, + defineComponent, + h, + type SlotsType +} from 'vue' import { NBaseClose, NBaseIcon } from '../../_internal' import { ErrorIcon, @@ -29,6 +35,14 @@ const iconRenderMap = { error: () => } +export interface DialogSlots { + action?: any + default?: any + header?: any + icon?: any + close?: any +} + export const NDialog = defineComponent({ name: 'Dialog', alias: [ @@ -39,6 +53,7 @@ export const NDialog = defineComponent({ ...(useTheme.props as ThemeProps), ...dialogProps }, + slots: Object as SlotsType, setup(props) { const { mergedComponentPropsRef,