0👍
If the formData.products
is correctly setting the values selected, then you can directly get the sum of values from the computed section.
computed:{
sum : function(){
let products = this.formData.products;
return products.reduce((a,b)=>{
return parseFloat(a.price) + parseFloat(b.price);
})
}
}
- [Vuejs]-Why does apollo muation return "Expecting a parsed GraphQL document" inside vuex?
- [Vuejs]-Does vue.config.js work when the project is created using webpack?
Source:stackexchange.com