对象数组根据指定属性去重

  this.data = this.data.filter((item, index, self) => { // 根据id 去重
        return index === self.findIndex(obj => obj.id === item.id)
      })
posted @ 2024-07-26 10:13  泽泽生龙  阅读(30)  评论(0)    收藏  举报