//把标题也加入content数组,并添加source字段
len = this.data.addNewData.titleImage.length
let tempArr = this.data.addNewData.content
let obj = {}
for (let i = 0; i < len; i++) {
obj = {
textOrImg: 'img',
img: this.data.addNewData.titleImage[i],
source: i //来源于标题第几条
}
tempArr.push(obj)
}
console.log(tempArr)
console.log(this.data.addNewData.content)
return
为什么这两个值打印出来一样啊,我没操作this.data.addNewData.content啊
let tempArr = [].concat(this.data.addNewData.content)