数组去重

this.header=this.header.reduce((acc, cur) => {
   const arrKey = acc.map(item => item.key);
   return arrKey.includes(cur.key) ? acc : [...acc, cur];
},[]);

 

posted @ 2021-08-23 16:06  一江春水向东刘小姐  阅读(36)  评论(0编辑  收藏  举报