三目運算符判斷三個條件


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 })
 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM