From 4c4fe1bf24a5f362633b58a7a763f4e8bfa0993c Mon Sep 17 00:00:00 2001 From: MidnightCrowing <110297461+MidnightCrowing@users.noreply.github.com> Date: Mon, 5 Aug 2024 19:52:15 +0800 Subject: [PATCH] fix(level-progress-bar): width display error (#953) --- src/components/TopBar/components/UserPanelPop.vue | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/components/TopBar/components/UserPanelPop.vue b/src/components/TopBar/components/UserPanelPop.vue index d6e0d986..0fee47fd 100644 --- a/src/components/TopBar/components/UserPanelPop.vue +++ b/src/components/TopBar/components/UserPanelPop.vue @@ -62,15 +62,9 @@ const otherLinks = computed((): { name: string, url: string, icon: string }[] => }) const levelProgressBarWidth = computed(() => { - const { next_exp: nextExp, current_exp: currentExp, current_min: minExp } = props.userInfo.level_info + const { next_exp: nextExp, current_exp: currentExp } = props.userInfo.level_info - const totalExp = nextExp - minExp - const earnedExp = currentExp - minExp - - if (totalExp === 0) - return '0%' - - const percentage = (earnedExp / totalExp) * 100 + const percentage = (currentExp / nextExp) * 100 return `${percentage.toFixed(2)}%` })