vue 去重数组中的对象

    unique(arr) {
      const res = new Map();
      return arr.filter(
        (arr) => !res.has(arr.strat_id) && res.set(arr.strat_id, 1)
      );
    },
posted @ 2021-04-27 20:54  起风了1573  阅读(721)  评论(0)    收藏  举报