BUG fix: user watchEffect
This commit is contained in:
parent
0c89063c66
commit
66fed15bcd
|
@ -274,6 +274,7 @@ $navNumber: v-bind(navItemNum);
|
|||
}
|
||||
}
|
||||
img {
|
||||
margin-left: 30px;
|
||||
height: 40px;
|
||||
width: 40px;
|
||||
cursor: pointer;
|
||||
|
|
|
@ -10,6 +10,12 @@ const currentPageUsername = ref(name)
|
|||
|
||||
const currentPageUserAvatar = ref(avatar)
|
||||
|
||||
const props = defineProps<{
|
||||
name?: string
|
||||
avatar?: string
|
||||
moemoepoint?: number
|
||||
}>()
|
||||
|
||||
// 这里用 watch 是不行的,要 watchEffect,是不是很迷?没错我也很迷啊哈哈哈
|
||||
watchEffect(() => {
|
||||
// 没有头像的用户
|
||||
|
@ -24,12 +30,6 @@ watchEffect(() => {
|
|||
}
|
||||
})
|
||||
|
||||
const props = defineProps<{
|
||||
name?: string
|
||||
avatar?: string
|
||||
moemoepoint?: number
|
||||
}>()
|
||||
|
||||
const mpWidth = computed(() => {
|
||||
return props.moemoepoint ? `${props.moemoepoint % 100}%` : '0%'
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue