v-show的用法

首先:在data(){ return{} } 里面定义remarkChargerVisible: {},
< el-table-column align = "errorRemark" prop = "menu" label = "备注情况" >
          < template slot-scope = "scope" >
          < span @click = " showRemarkCharger(scope.row) " v-show = " ! remarkChargerVisible[scope.row.errorId] " >
               < el-popover v-if = " scope.row.errorRemark " placement = "top-start" width = "200" trigger = "hover" >
                     < span > {{scope.row.errorRemark}} </ span >
                           < span slot = "reference" > {{scope.row.errorRemark}}
                                    < i class = "el-icon-edit" ></ i >
                           </ span >
              </ el-popover >
             < span style = "color:#B0E2FF" v-if = " ! scope.row.errorRemark " > 添加备注 </ span >
         </ span >
        < el-input type = "textarea" :maxlength = " 30 " placeholder = "请输入内容"
                        v-model = " modifyChargerRemarkParam.chargerErrorRemark "          
                       @blur = " saveChargerRemark(scope.row) "
                        v-show = " remarkChargerVisible[scope.row.errorId] " >
       </ el-input >
      </ template >
</ el-table-column >
showRemarkCharger(row) {
    if ( this .remarkedit) { return ; }
    this .modifyChargerRemarkParam.chargerErrorRemark = row.errorRemark;
    this .remarkedit = true ;
    this .$set( this .remarkChargerVisible, row.errorId, true );
},
saveChargerRemark(row) {
   this .modifyChargerRemarkParam.chargerErrorId = row.errorId;
   modifyChargerRemark( this .modifyChargerRemarkParam).then(() => {
   this .queryChargerListData();
   this .chargerRemarkDialogVisible = false ;
   this .$notify({
        title: "成功" ,
          message: "修改备注成功" ,
         type: "success" ,
         duration: 2000
      });
  });
  this .remarkedit = false ;
  this .modifyChargerRemarkParam = {};
  this .$set( this .remarkChargerVisible, row.errorId, false );
},

转载于:https://my.oschina.net/u/4013226/blog/2907150

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值