From 08fe00df6d8701f7185e6c29c41dd61619e76a40 Mon Sep 17 00:00:00 2001 From: Chris <1633711653@qq.com> Date: Tue, 29 Nov 2022 14:00:06 +0800 Subject: [PATCH] fix(avatar): update default bg color (#214) --- components/account/AccountAvatar.vue | 6 +++++- components/account/AccountHeader.vue | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/components/account/AccountAvatar.vue b/components/account/AccountAvatar.vue index 4d7fa57d..08c29fe4 100644 --- a/components/account/AccountAvatar.vue +++ b/components/account/AccountAvatar.vue @@ -4,6 +4,8 @@ import type { Account } from 'masto' defineProps<{ account: Account }>() + +const loaded = $ref(false) @@ -12,7 +14,9 @@ defineProps<{ :src="account.avatar" :alt="account.username" loading="lazy" - rounded-full bg-gray:10 + rounded-full + :class="loaded ? 'bg-gray' : 'bg-gray:10'" v-bind="$attrs" + @load="loaded = true" > diff --git a/components/account/AccountHeader.vue b/components/account/AccountHeader.vue index 4ab160b6..5f21e7da 100644 --- a/components/account/AccountHeader.vue +++ b/components/account/AccountHeader.vue @@ -80,7 +80,7 @@ watchEffect(() => {