From 037a2fc8fac102871692479888f9b3ab1126f8fa Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Mon, 11 Mar 2024 17:38:42 +0100 Subject: [PATCH] chore(Avatar): use `text` prop to prevent breaking change --- src/runtime/components/Avatar.vue | 13 +++++++------ test/components/Avatar.spec.ts | 2 +- test/components/__snapshots__/Avatar.spec.ts.snap | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/runtime/components/Avatar.vue b/src/runtime/components/Avatar.vue index 053b1671..fcc23fc7 100644 --- a/src/runtime/components/Avatar.vue +++ b/src/runtime/components/Avatar.vue @@ -16,7 +16,7 @@ export interface AvatarProps extends Omit, Omit @@ -30,18 +30,19 @@ import { reactivePick } from '@vueuse/core' const props = defineProps() -const forwardRoot = useForwardProps(reactivePick(props, 'as')) -const forwardFallback = useForwardProps(reactivePick(props, 'delayMs')) +const rootProps = useForwardProps(reactivePick(props, 'as')) +const fallbackProps = useForwardProps(reactivePick(props, 'delayMs')) -const fallback = computed(() => props.fallback || (props.alt || '').split(' ').map(word => word.charAt(0)).join('').substring(0, 2)) +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 }))