表单操作 删除tableData的数据
3 回答

互换的青春
TA贡献1797条经验 获得超6个赞
试试这个
class Foo{
constructor(){
this.arr_select=[3,1,2,6,8,10,5];
this.tableData=[{id:12},{id:2},{id:10},{id:1},{id:3},{id:5},{id:4}]
}
delAll(){
this.tableData=this.tableData.filter(j=>!this.arr_select.find(v=>v===j.id,this))
}
}
let foo = new Foo();
foo.delAll();
console.log(foo.tableData)
添加回答
举报
0/150
提交
取消