this.items=res.data.data.list.list
this.page=res.data.data.list.page
let this_items = [];
this.items.forEach(function(val,index,arrList){
val.log.forEach(function(item,index_1,arrLog){
arrLog[index_1][‘title‘]=item[‘name‘];
arrLog[index_1][‘desc‘]=item[‘day‘];
arrList[index][‘log‘][index_1]=arrLog[index_1];
})
this_items=arrList;
})
this.items = this_items;
或则
this.items=res.data.data.list.list
this.page=res.data.data.list.page
let this_items = [];
this.items.forEach(function(val,index,arrList){
val.log.forEach(function(item,index_1,arrLog){
item[‘title‘]=item[‘name‘];
item[‘desc‘]=item[‘day‘];
arrList[index][‘log‘][index_1]=item;
})
this_items=arrList;
})
this.items = this_items;
原文:https://www.cnblogs.com/zimukong/p/13324655.html