vue中可以使用some方法查找需要删除的数据
this.list.some((item, i) => {
if (item.id == id) {
this.list.splice(i, 1)
return true;
}
})
也可使用findIndex方法
var index = this.list.findIndex(item => {
if (item.id == id){
return true;
}
})
this.list.splice(index, 1)
然后使用splice方法删除该索引指向的数据
this.list.splice(index,i)//i表示需要删除的数据数量