diff --git a/playground/pages/avatar.vue b/playground/pages/avatar.vue index a35415d9..bfddab0d 100644 --- a/playground/pages/avatar.vue +++ b/playground/pages/avatar.vue @@ -5,7 +5,7 @@ const sizes = Object.keys(theme.variants.size) diff --git a/playground/pages/chip.vue b/playground/pages/chip.vue index 3066da1c..582bb4c6 100644 --- a/playground/pages/chip.vue +++ b/playground/pages/chip.vue @@ -31,7 +31,7 @@ const items = [{
- +
diff --git a/src/runtime/components/Avatar.vue b/src/runtime/components/Avatar.vue index 10060b32..52c8cb2f 100644 --- a/src/runtime/components/Avatar.vue +++ b/src/runtime/components/Avatar.vue @@ -28,6 +28,7 @@ import { computed } from 'vue' import { AvatarRoot, AvatarImage, AvatarFallback, useForwardProps } from 'radix-vue' import { reactivePick } from '@vueuse/core' import { UIcon } from '#components' +import { useAvatarGroup } from '#imports' const props = defineProps() @@ -35,7 +36,9 @@ const fallbackProps = useForwardProps(reactivePick(props, 'delayMs')) const fallback = computed(() => props.text || (props.alt || '').split(' ').map(word => word.charAt(0)).join('').substring(0, 2)) -const ui = computed(() => tv({ extend: avatar, slots: props.ui })({ size: props.size })) +const { size } = useAvatarGroup(props) + +const ui = computed(() => tv({ extend: avatar, slots: props.ui })({ size: size.value }))