fix the total

This commit is contained in:
Andreas Zweili 2021-05-05 16:29:53 +02:00
parent df8208dc0f
commit d24dbab797
1 changed files with 10 additions and 3 deletions

View File

@ -1,8 +1,15 @@
export default {
finalTotal(state) {
return state.total.toFixed(2);
},
quantity(state) {
return state.qty;
},
items(state) {
return state.items;
},
total(state) {
var total = 0;
state.items.forEach(item => {
total = total + item.price;
});
return total.toFixed(2);
}
};