三目运算符判断三个条件


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