An array of objects merge and de-duplication, consolidation and deduplication array of objects

The id and combined to re-object array
this.tableData = this.unique(this.tableData.concat(this.multipleSelectionAll))

unique(arr) {
  const res = new Map();
  return arr.filter((arr) => !res.has(arr.id) && res.set(arr.id, 1))
},

  

Guess you like

Origin www.cnblogs.com/shuihanxiao/p/11310176.html