let arr = res.data let arr1 = [...this.list] arr = arr.filter(item => { let arrlist = arr1.map(v => v.id) return !arrlist.includes(item.id) }) this.data2 = arr
js 删除两个数组中id相同的对象
最新推荐文章于 2024-08-25 15:58:33 发布
let arr = res.data let arr1 = [...this.list] arr = arr.filter(item => { let arrlist = arr1.map(v => v.id) return !arrlist.includes(item.id) }) this.data2 = arr