两个数组对象合并后放至el-table组件报错:You may have an infinite update loop

后端传过来的数组对象不能满足需求需要给数组对象中的item再加一个数组,类似这种格式:[{a:1,b:2, c:[{d:6, w:9}]}],c就是新增加的key,然后选择的数组和现有的数组合并到this.productList,再渲染到el-table,el-table可以展开含有子表,这样就报错了You may have an infinite update loop in a component render function. found in,请问大神怎么解决这样的报错,谢谢!(以下是报错的函数)

两个数组对象合并后放至el-table组件报错:You may have an infinite update loop

getSelectData(val) {

if (this.productList.length) {

this.productList = this.productList.concat(val);

} else {

this.productList = val;

}

this.productList.forEach((item, index) => {

if(!item.ordersDetails){

let obj = {};

item.ordersDetails = [];

obj.country = item.country;

obj.platform = item.platform;

obj.shopCode = item.shopCode;

item.ordersDetails.push(obj);

}

});

}

以上是 两个数组对象合并后放至el-table组件报错:You may have an infinite update loop 的全部内容, 来源链接: utcz.com/p/936640.html

回到顶部