一些常用数组操作

两个数组比较相同的去掉
this.modalTable = this.modalTable.filter(item => !this.syllableList.includes(item.id));//删除选中音节数据
去重
// this.syllableList = Array.from(new Set(this.syllableList))
静态删除选中
this.modalTable.forEach((item,index) => {
this.selectList.forEach(ele=>{
if(ele.id==item.id){
this.modalTable.splice(index,1);
}
})
});//删除选中音节数据

posted @ 2021-06-01 10:15  everseven  阅读(40)  评论(0)    收藏  举报