老师啊 vm不能用 是没定义啊
var vm=this; 才可以啊
为你第一次尝试写 表示佩服啊 勇气可嘉啊!!!
var vm=this; 才可以啊
为你第一次尝试写 表示佩服啊 勇气可嘉啊!!!
2018-04-27
其实也可以使用过滤器来实现总金额的计算
{{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