fieldType:this.selectitem[index].fieldTypes=='字符'?1:(this.selectitem[index].fieldTypes=='數字'?0:2),
// 數組過濾函數
difference(arr = [], oarr = []) {
return arr.reduce((t, v) => (!oarr.includes(v) && t.push(v), t), [])
},
// 數組對象去重
let hash = {};
this.columns.splice(this.treedata.length,1,{ label: '狀態', key: 'opStates' })
const newArr = this.columns.reduceRight((item, next) => {
hash[next.label] ? '' : hash[next.label] = true && item.push(next);
return item
}, []);
console.log(newArr);
this.columns = newArr
//提取數組對象的屬性成一個新的數組
this.columns.push({ label:_itemChild.columnName, key: _itemChild.resExtRealId })