0
getSubTotal(dataSet) {
return this.dataSet.map(function(data) {
return data.price;
})
0
Okay so I was able to figure this out.
dataSet: [
{
"price": 49,
"qty": 1,
},
{
"price": 29,
"qty": 1,
},
]
subTotals(data) {
const calcArray = [data.price, data.qty];
return calcArray.reduce((a,b)=> {
//multiply price by quantity for subtotal
return a*b;
});
}
- [Vuejs]-Vue โ v-for attaching computed props
- [Vuejs]-How do I pass data to the key and link of a link element?
Source:stackexchange.com