Answer the question
In order to leave comments, you need to log in
How to calculate the amount?
How can I calculate the total sum of elements?
This is the array to which the elements will be added. item.price - the price of one item and I need to add it to the rest of the items outside this array
tr(v-for="(item, index) in cartItems" v-show="numCartItems != 0" )
td 1
td(class="width-img-td")
img(:src="item.img" class="imgs")
td(v-model="took_item") {{ item.title }}
td(v-show="numCartItems != 0" ) {{ numCartItems }}
td шт
td {{ item.price }}
data:{
encoder: 25000,
cardData: 2500,
mifare: 120,
programmator: 58000
}
computed: {
total(){
var b = this.encoder;
var c = this.cardData;
var d = this.mifare;
var e = this.programmator;
return item.price + b + c + d + e;
}
}
},
}
tr
td(colspan="7" class="right -bold") Итого за оборудование:
td {{total}} ₽
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question