mirror of
https://github.com/BewlyBewly/BewlyBewly.git
synced 2025-04-14 13:15:29 +00:00
fix(level-progress-bar): width display error (#953)
This commit is contained in:
@@ -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)}%`
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user