三目运算符判断三个条件

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

 

posted @ 2020-07-13 16:10  hongwj  阅读(1670)  评论(0编辑  收藏  举报