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不可编辑
}

  


  

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM