quChong(obj) {
this.arrary=[]
const res = new Map();
this.arrary=obj.filter((a) => !res.has(a.name) && res.set(a.name, 1))
}
vue 过滤数组中的重复对象
最新推荐文章于 2024-04-04 01:51:46 发布
quChong(obj) {
this.arrary=[]
const res = new Map();
this.arrary=obj.filter((a) => !res.has(a.name) && res.set(a.name, 1))
}