首页 > 其他 > 详细

Vue + Element table中的某行触发enter事件后,使该行disabled

时间:2020-06-11 21:12:20      阅读:108      评论:0      收藏:0      [点我收藏+]

废话不罗嗦,上硬菜。

 

1.html下:
<el-table-column label="名称" sortable>
  <template slot-scope="scope"> 
    <el-input v-model="scope.row.name" :disabled="Disabled[scope.$index]" @keydown.enter.native="Enter(scope.row,scope.$index)"> </el-input>
  </template>
</el-table-column>
2.data--->>>return中:
  
Disabled:[],     // 该行是否禁止编辑
3.函数中:
Enter( row,index){
 this.Disabled[index] = true,      // 使input不可编辑
}

  


  

 

Vue + Element table中的某行触发enter事件后,使该行disabled

原文:https://www.cnblogs.com/xintao/p/13096027.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!