diff --git a/src/avatar/index.ts b/src/avatar/index.ts index a57511cdd5a..821f86b69fe 100644 --- a/src/avatar/index.ts +++ b/src/avatar/index.ts @@ -1,2 +1,2 @@ export { avatarProps, default as NAvatar } from './src/Avatar' -export type { AvatarProps } from './src/Avatar' +export type { AvatarProps, AvatarSlots } from './src/Avatar' diff --git a/src/avatar/src/Avatar.tsx b/src/avatar/src/Avatar.tsx index 43d28a85c88..e4071a4f922 100644 --- a/src/avatar/src/Avatar.tsx +++ b/src/avatar/src/Avatar.tsx @@ -12,6 +12,7 @@ import { onMounted, type PropType, ref, + type SlotsType, type VNodeChild, watch, watchEffect @@ -65,9 +66,16 @@ export const avatarProps = { export type AvatarProps = ExtractPublicPropTypes +export interface AvatarSlots { + default: any + placeholder: any + fallback: any +} + export default defineComponent({ name: 'Avatar', props: avatarProps, + slots: Object as SlotsType, setup(props) { const { mergedClsPrefixRef, inlineThemeDisabled } = useConfig(props) const hasLoadErrorRef = ref(false)