sum(){ return this.products.reduce((total,next)=>{ return total + next.price * next.aumout},0) }
数组.reduce((参数1,参数2)=>函数{},0参数末定义初始值0)
total ,初始为0. 参数。。
v-for 数组循环
v-modle 取值
javascript reduce 前端交互 总计
原文:https://www.cnblogs.com/crave/p/11630343.html