将两个数组合并成一个数组,对应项相同

it2024-05-09  55

let one = []; let two = []; let AllMes = []; this.pileInformation.forEach( (item, index) => { if(index%2){ two.push(item) } else { one.push(item) } }) one.forEach( (item, index) => { AllMes.push([item,two[index]]) }) this.$set(this,'AllDate',AllMes)

最新回复(0)