iview render button 修改单个的样式或者禁用或者隐藏

render: (h, params) => {
              return h('div', [
                h('span', {style: {marginRight: '5px'},}, this.$t('liveRate_lang.th.whetherOpen')),
                h('i-switch', {
                  props: {
                    value: params.row.autoUpdate  //控制开关的打开或关闭状态,官网文档属性是value
                  },
                  style: {marginRight: '5px'},
                  on: {
                    'on-change': () => {
                      this.changeOneRateSetting(params)
                    }
                  }
                }),
                h('Button', {
                  props: {type: 'primary',size: 'small'},
                  style: {marginRight: '5px'},
                  on: {
                    click: () => {
                      this.changeRateEdit(params.index)
                    }
                  }
                }, this.$t('liveRate_lang.btn.edit')),
                h('Button', {
                  props: {type: 'primary',size: 'small'},
                  style: {marginRight: '5px'},
                  on: {
                    click: () => {
                      this.changeRateReview(params)
                    }
                  },
                  attrs: {
                    //按钮禁用
                    disabled: params.row.status == 'U' ? false : true
                  },
                }, params.row.status == 'U' ? this.$t('liveRate_lang.btn.review') : this.$t('liveRate_lang.btn.reviewSF')),
                   //params.row.AuthStatus == 0 ? "待审核" : params.row.AuthStatus == 1 ? "已审核" : "已拒绝"
              )
              ]);
            }

  

  

posted @ 2020-09-15 10:38  爱跑步的乌龟  阅读(1300)  评论(0编辑  收藏  举报