diff --git a/src/button/index.ts b/src/button/index.ts index 6985a9ff9f5..0bb775f78b5 100644 --- a/src/button/index.ts +++ b/src/button/index.ts @@ -3,4 +3,4 @@ export { default as NButton, XButton as NxButton } from './src/Button' -export type { ButtonProps } from './src/Button' +export type { ButtonProps, ButtonSlots } from './src/Button' diff --git a/src/button/src/Button.tsx b/src/button/src/Button.tsx index 191c788ea32..06246048ae0 100644 --- a/src/button/src/Button.tsx +++ b/src/button/src/Button.tsx @@ -15,6 +15,7 @@ import { inject, type PropType, ref, + type SlotsType, type VNodeChild, watchEffect } from 'vue' @@ -95,9 +96,15 @@ export const buttonProps = { export type ButtonProps = ExtractPublicPropTypes +export interface ButtonSlots { + default?: any + icon?: any +} + const Button = defineComponent({ name: 'Button', props: buttonProps, + slots: Object as SlotsType, setup(props) { if (__DEV__) { watchEffect(() => {