Is there a way to have an incremented value in this code snippet?
:data-value="Math.round(elecs[index].obtenus/elecs[index].maxsiege*100)
Here is my attempt at iteration :
:data-value="Math.round(result += elecs[index].obtenus/elecs[index].maxsiege*100)
Any help or suggestions would be appreciated!
Additionally :
<ul class="pie-wrapper" >
<li v-for="(elec, index) in elecs" :key="index" v-if="elecs[index].obtenus != 0" class="arc" :data-value="Math.round(elecs[index].obtenus/elecs[index].maxsiege*100)">
<b>{{ elecs[index].Sigle }} </b>
<span>{{elecs[index].obtenus}}/{{elecs[index].maxsiege}}</span>
</li>
</ul>
script :
export default {
async asyncData({ params }) {
... json
return {
...json
}
},
methods: {
toCurrencyString(number){
return number.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ");
}
}
}