typescript 数组根据指定字段去重
this.listDataIn = data.Result.data; const uniqueItems: Item[] = Array.from( new Set(this.listDataIn.map(item => item.MyLandID)) ).map(id => { return obj.listDataIn.find(item => item.MyLandID === id); }); obj.listt = uniqueItems; console.log(uniqueItems);