mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-20 15:01:46 +01:00
fix(AvatarGroup): handle deep children
This commit is contained in:
@@ -4,9 +4,9 @@ import type { AvatarGroupProps } from '../types'
|
||||
export const avatarGroupInjectionKey: InjectionKey<ComputedRef<{ size: AvatarGroupProps['size'] }>> = Symbol('nuxt-ui.avatar-group')
|
||||
|
||||
export function useAvatarGroup(props: { size: AvatarGroupProps['size'] }) {
|
||||
const injectedSize = inject(avatarGroupInjectionKey, undefined)
|
||||
const avatarGroup = inject(avatarGroupInjectionKey, undefined)
|
||||
|
||||
const size = computed(() => props.size ?? injectedSize?.value.size)
|
||||
const size = computed(() => props.size ?? avatarGroup?.value.size)
|
||||
provide(avatarGroupInjectionKey, computed(() => ({ size: size.value })))
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user