数组元素实现累加
this.vehicleEcuNum = [{ecuId: '1,2,3'},{ecuId: '4,5,6'}]
this.vehicleEcuNum = this.dataList
.map((item) => {
return item.ecuId.split(',').length
})
.reduce((x, y) => x + y)
this.vehicleEcuNum = [{ecuId: '1,2,3'},{ecuId: '4,5,6'}]
this.vehicleEcuNum = this.dataList
.map((item) => {
return item.ecuId.split(',').length
})
.reduce((x, y) => x + y)