向数组infoLists中每个对象添加名为imgSrc的属性,属性值从数组imgUrl中获取
var arr = this.infoList
var curData = []
arr.forEach((item, index) => {
curData.push(
Object.assign({}, item, {‘imgSrc’: this.imgUrl[index]})
)
}
this.infoList = []
this.infoList = curData
未来还长,热血未凉