fixed bug with index type

This commit is contained in:
Kostya
2024-01-20 13:13:51 +03:00
parent 70cb8c6564
commit ec54e06431
2 changed files with 6 additions and 4 deletions

View File

@@ -237,6 +237,7 @@ input[type="number"]::-webkit-outer-spin-button {
.steps-btns__display span { .steps-btns__display span {
display: flex; display: flex;
color: #adadad;
} }
.btns-style__steps button { .btns-style__steps button {

View File

@@ -48,7 +48,7 @@
<template v-for="(item, index) in PercentageGameSteps" :key="index"> <template v-for="(item, index) in PercentageGameSteps" :key="index">
<swiper-slide> <swiper-slide>
<div class="steps-btns__display"> <div class="steps-btns__display">
<button>{{ item.toFixed(2) }} <span>{{ index + 1 }} {{ stepsEndOfWord(index) }}</span></button> <button>x{{ item.toFixed(2) }} <span>{{ index + 1 }} {{ stepsEndOfWord(index + 1) }}</span></button>
</div> </div>
</swiper-slide> </swiper-slide>
</template> </template>
@@ -192,9 +192,10 @@ export default {
} }
}, },
stepsEndOfWord(index) { stepsEndOfWord(index) {
let lastNumber = String(index) const indexString = String(index)
if (index >= 10) { let lastNumber = indexString
lastNumber = index.slice(1) if (indexString >= 10) {
lastNumber = indexString.slice(1)
console.log(lastNumber) console.log(lastNumber)
} }
return this.checkLastNumber(lastNumber) return this.checkLastNumber(lastNumber)