Vue + Element table中的某行触发enter事件后,使该行disabled
废话不罗嗦,上硬菜。
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不可编辑
}相关推荐
  laohyx    2020-06-11  
   happyfreeangel    2020-04-11  
   HongKongPython    2020-03-07  
   masternan    2020-03-01  
   81463166    2020-01-09  
   fanhuasijin    2019-12-20  
   guoddoutlookcom    2008-06-07  
   zhangpan    2019-10-30  
   Will0    2010-06-16  
   晏    2019-09-07  
   liangston    2012-09-17  
   yuqiuyao    2018-11-23  
   hackcat    2017-03-13  
   89203856    2015-05-06  
   benjonc    2019-06-27  
   yongqiling    2013-08-29  
   whiteShiKu    2012-08-11  
   80163956    2018-07-26  
   MzTestor    2019-04-18  
 