vue 对json数据做了改动 console显示正确,for循环不出来 5
letparams={params:{action:"QueryPersonal",Email:json[0].UserName}};API.queryPersonal(...
let params = { params: { action: "QueryPersonal", Email: json[0].UserName } };
API.queryPersonal(params).then(res => {
for(let i=0;i<res.total;i++)
{
let params2 = { params: {
action: "getGiftList",
OrderID: res.rows[i]["OrderID"]
}};
API.getGiftList(params2).then(res2 =>{
res.rows[i].list=res2.rows
});
}
this.orderList = res.rows;
console.log(this.orderList)
this orderList.list无法在for中循环出,
但console.log可以看到增加的list属性及值 展开
API.queryPersonal(params).then(res => {
for(let i=0;i<res.total;i++)
{
let params2 = { params: {
action: "getGiftList",
OrderID: res.rows[i]["OrderID"]
}};
API.getGiftList(params2).then(res2 =>{
res.rows[i].list=res2.rows
});
}
this.orderList = res.rows;
console.log(this.orderList)
this orderList.list无法在for中循环出,
但console.log可以看到增加的list属性及值 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询