vue iview table列表操作 render(显示和隐藏)

 methods:{
            init(){
                let cloneData =  Object.assign({},this.libraryList)
                let handles = []
                this.columns1.map((item)=>{
                    if(item.key === "handle") {
                        handles.push(item)
                    }
                })
                handles.forEach((item)=>{
                    this.$set(item,'render',(h,params) =>{
                        let flag = cloneData[params.index].isEnableFingerBorrow === 1
                        // let flag = true
                        return h('div',{
                            'class':'handle',
                            'style':{
                                'color':'#ff4700',
                                'cursor':'pointer'
                            }
                        },[
                            h('span',{
                                on:{
                                    click: ()=>{
                                        this.handleDetailed(params.row)
                                    }
                                }
                            },'图书馆配置'),
                            flag ? h('span',{
                                style:{
                                    'margin-left':'10px'
                                },
                                on:{
                                    click: ()=>{
                                        this.handleFinger(params.row)
                                    }
                                }
                            },'指纹借书') : ""
                        ])
                    })
                })    
            },
        //获取列表时候,   this.init()
    }    

猜你喜欢

转载自www.cnblogs.com/wangdashi/p/9378270.html