From 66fed15bcdfc96567db453cfc5986fd99965e63b Mon Sep 17 00:00:00 2001 From: KUN1007 Date: Sun, 22 Oct 2023 21:12:35 +0800 Subject: [PATCH] BUG fix: user watchEffect --- src/components/top-bar/KUNGalgameTopBar.vue | 1 + src/views/kungalgamer/components/Header.vue | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/top-bar/KUNGalgameTopBar.vue b/src/components/top-bar/KUNGalgameTopBar.vue index 691ff275..42ba74c2 100644 --- a/src/components/top-bar/KUNGalgameTopBar.vue +++ b/src/components/top-bar/KUNGalgameTopBar.vue @@ -274,6 +274,7 @@ $navNumber: v-bind(navItemNum); } } img { + margin-left: 30px; height: 40px; width: 40px; cursor: pointer; diff --git a/src/views/kungalgamer/components/Header.vue b/src/views/kungalgamer/components/Header.vue index 3257c851..f8f7e27e 100644 --- a/src/views/kungalgamer/components/Header.vue +++ b/src/views/kungalgamer/components/Header.vue @@ -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%' })