vue 删除嵌套多层对象数组,页面不刷新问题
2022-11-10 本文已影响0人
X俊逍遥
for (var i = 0; i < this.goods[key][index][colIndex].length; i++) {
if (this.goods[key][index][colIndex][i].goodsId === tag.goodsId) {
let newArr = this.lodash.cloneDeep(this.goods[key][index][[colIndex]])
newArr.splice(i, 1)
this.$set(this.goods[key][index], colIndex, newArr)
this.goods = this.lodash.cloneDeep(this.goods)
}
}
深拷贝对应的嵌套对象,重新赋值