欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

對Vue table 動態(tài)表格td可編輯的方法詳解

 更新時間:2018年08月28日 14:57:16   作者:井底小蛙  
今天小編就為大家分享一篇對Vue table 動態(tài)表格td可編輯的方法詳解,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧

項目中需求用到可編輯表格

下圖這種 ↓

element UI 組件table表格中 增加template 模版

翻入input

根據(jù)業(yè)務(wù)邏輯增加全局變量 isEdit 是否變化。

<el-table-column
 label="名稱"
 width="140">
 <template scope="scope">
  <el-input v-if="scope.row.isEdit && scope.row.status === 0" v-model="scope.row.name" ></el-input>
  <label v-if="scope.row.status === 1" class="indisable">{{scope.row.name +'(已禁用)' || '--'}}</label>
  <label v-if="!scope.row.isEdit && scope.row.status === 0">{{scope.row.name || '--'}}</label>
  </template>
</el-table-column>

編輯函數(shù) :@lick="edit"

 edit (val) {
  this.initUpdateVal = val.name
  val.isEdit = true
  },

以上這篇對Vue table 動態(tài)表格td可編輯的方法詳解就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論