const list=reactive([
{name:'路飞',age:18},
{name:'索隆',age:20},
{name:'山治',age:20},
{name:'乔巴',age:7},
{name:'娜美',age:22},
{name:'甚平',age:45},
{name:'乌索普',age:22},
])
const Btn=()=>{
const obj={}
const newArr = [] as any[];
quchong.forEach(i=>{
if(!obj[i.age]){
newArr.push(i)
obj[i.age]=true
}
})
console.log(newArr);
}
vue数组去重
于 2021-09-29 13:16:12 首次发布