1、方法
<!--
* @Descripttion: 数组去重
* @version: 0.0.1
* @Author: PengShuai
* @Date: 2022-09-26 13:16:04
* @LastEditors: PengShuai
* @LastEditTime: 2022-09-27 11:52:41
-->
// array 传入数组
// id 唯一键
baseUniq(array, id) {
//数组去重
var temp = [] //一个新的临时数组
for (var i = 0; i < array.length; i++) {
if (!temp.some((v) => v[id] == array[i][id])) {
temp.push(array[i])
}
}
return temp
}
// 调用
this.baseUniq(array,id)