Skip to content

Commit

Permalink
feat(avatar): add slots type (tusen-ai#6599)
Browse files Browse the repository at this point in the history
  • Loading branch information
nailiable committed Dec 7, 2024
1 parent 00c775c commit 6efc1ff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/avatar/index.ts
Original file line number Diff line number Diff line change
@@ -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'
8 changes: 8 additions & 0 deletions src/avatar/src/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
onMounted,
type PropType,
ref,
type SlotsType,
type VNodeChild,
watch,
watchEffect
Expand Down Expand Up @@ -65,9 +66,16 @@ export const avatarProps = {

export type AvatarProps = ExtractPublicPropTypes<typeof avatarProps>

export interface AvatarSlots {
default: any
placeholder: any
fallback: any
}

export default defineComponent({
name: 'Avatar',
props: avatarProps,
slots: Object as SlotsType<AvatarSlots>,
setup(props) {
const { mergedClsPrefixRef, inlineThemeDisabled } = useConfig(props)
const hasLoadErrorRef = ref(false)
Expand Down

0 comments on commit 6efc1ff

Please sign in to comment.