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