filter的用法与使用场景:筛选数据
//this.allCollectorList:后台给定的所有可供选择数据 //this.collectorData:目前已经存在选中列表中的数据//目前已经存在选中列表中的数据id getSelIdList() {let eIdList = []this.collectorData.forEach(row => {eIdList.push(row.id)})return eIdList },//在中的数据列表中删除目前已经存在的数据,就是余下全部数据 filterCollec() {let eIdList = this.getSelIdList()this.allCollectorData = this.allCollectorList.filter(row => {return eIdList.indexOf(row.id) == -1}) },
1、使用场景:筛选数据后台给了多选框的数据列表,前端通过选中和反选,传值给后台多选框的id,记录实际的XX类型
typeList = [{"id": "1","code": "1","name": "通讯","type": 1,"status": 1,"remark": null,"pid": null,"ext1": "","ext2&