1、两个带对象的数组中,筛选出不相等的对象
this.dataSource 是原始的数据源,总数组
this.selectedRows 是表格选择后带对象的数组
const newDataSource = this.dataSource.filter((item, index) => {
return JSON.stringify(item).indexOf(JSON.stringify(this.selectedRows[index])) == -1 })
2、带对象的数组去重
const object = {}
const newobject = this.serialOk.filter(item => (object[item.serialno] ? ' ' : (object[item.serialno] = true)))
3、纯数组去重
const newArr = [...new Set(arr)]