头像更新联动bug

This commit is contained in:
bob
2025-03-19 11:10:40 +08:00
parent b363564229
commit b926ad7ce4
2 changed files with 16 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
<script setup>
import { ref, computed, nextTick } from 'vue'
import { ref, computed, nextTick, watch } from 'vue'
import {
Close,
Male,
@@ -135,12 +135,18 @@ const onVideoCall = () => {
ElMessage.warning('功能开发中')
}
const showAvatar = ref(userCardData.userInfo.avatarThumb || default_avatar)
const showAvatar = ref(userCardData.userInfo.avatarThumb)
const handleAvatarError = () => {
console.log('handleAvatarError')
showAvatar.value = default_avatar
}
watch(
() => userCardData.userInfo.avatarThumb,
(newValue) => {
showAvatar.value = newValue
}
)
</script>
<template>

View File

@@ -43,6 +43,13 @@ const handleAvatarError = () => {
showAvatar.value = default_avatar
}
watch(
() => userData.user.avatarThumb,
(newValue) => {
showAvatar.value = newValue
}
)
watch(
() => props.isShow,
(newValue) => {