vue 从后端拿到的数字进行相加
情形:后端传来属性值,数据类型为string。然后我需要把属性值转化为数字再相加let _this = thisequipmentRes.data.forEach(function (elem, index) {let str = elem.value - 0_this.all.equipment += str})
·
情形:后端传来属性值,数据类型为string。然后我需要把属性值转化为数字再相加
let _this = this
equipmentRes.data.forEach(function (elem, index) {
let str = elem.value - 0
_this.all.equipment += str
})
更多推荐
已为社区贡献11条内容
所有评论(0)