【发布时间】:2020-10-05 07:55:38
【问题描述】:
这是我的查询结果
{1: {deduction: 625}, 2: {deduction: 500}, 3: {deduction: 2500}, grandTotal: 8460, otTotal: 50,…}
1: {deduction: 625}
2: {deduction: 500}
3: {deduction: 2500}
allowance: 0
grandTotal: 8460
otTotal: 50
我在 vue 中计算得到一个错误
"TypeError: this.grand.reduce is not a function"
totaldeduct(){
return this.grand.reduce((acc, item)=>{
return acc+ Number(item.deduction)
},0)
}
【问题讨论】:
标签: javascript arrays vue.js