Browse Source

修复金币超长UI错乱BUG

master
许孟阳 2 weeks ago
parent
commit
cedbe1eac5
  1. 15
      src/views/backpack/player.vue

15
src/views/backpack/player.vue

@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
<div>{{ state.rebornPoints.count }}</div>
<div> {{ state.playerAttribute.lv }} </div>
<div v-for="attr in attrs" :key="attr">{{ attribute[attr] }}{{ attr_unitys[attr] }} </div>
<div> {{ state.playerAttribute.coins }} </div>
<div> {{ coins }} </div>
</div>
</div>
<div class="equips">
@ -54,6 +54,16 @@ const attribute = computed(() => { @@ -54,6 +54,16 @@ const attribute = computed(() => {
const playerImg = require("@/assets/player.png")
const playerImg2 = require("@/assets/player2.png")
const attrs = ['dps', 'atk', 'crit', 'critDmg', 'hp', 'def', 'bloc'];
const coins = computed(() => {
const coins = state.playerAttribute.coins;
if (coins > 100000000) {
return (coins / 1000000).toFixed(1) + 'm';
}
if (coins > 100000) {
return (coins / 1000).toFixed(1) + 'k';
}
return coins;
})
onMounted(() => { });
</script>
@ -77,13 +87,14 @@ onMounted(() => { }); @@ -77,13 +87,14 @@ onMounted(() => { });
width: 5.5rem;
height: 100%;
color: #f87d02;
text-align: start;
}
.value {
float: left;
// width: 5rem;
height: 100%;
color: #f3bb82;
text-align: start;
}
}

Loading…
Cancel
Save