其实也可以使用过滤器来实现总金额的计算
{{productList | calculate | formatMoney}}
filters:
calculate: function(list){
var total = 0;
list.forEach(function(item, index){
if(item.checked){
total += item.productPrice * item.productQuantity;
}
});
return total;
}
{{productList | calculate | formatMoney}}
filters:
calculate: function(list){
var total = 0;
list.forEach(function(item, index){
if(item.checked){
total += item.productPrice * item.productQuantity;
}
});
return total;
}
2018-04-11