TreeList({ parentId: this.chuanshu }).then((res) => {
let arr1 = this.unique(res.rows.map((item) => {
return item;
})
);
this.checkboxList = arr1;
});
unique(arr) {
const res = new Map();
return arr.filter((arr) => !res.has(arr.typeId) && res.set(arr.typeId, 1));
},
针对那个去重就写那个Key值 我去的是数组里的typeId 去别的话就在unique方法里的arr后面写那个key值