element ui 實現可編輯表格


 

 

 

 

 

     <el-table :data="powerMessageTableAll" border"  @cell-click="cellclick"
        >
        

          <el-table-column show-overflow-tooltip prop="" label="交易編碼" width="120">
            <template slot-scope="scope">
              <el-input ref="gain" size="mini" v-if="scope.row.isOK" @keyup.native.enter="blurClick(scope)" @blur="blurClick(scope)" v-model="scope.row.planCode" style="width:100%;hight:100%"></el-input>
              <span size="mini" v-else>{{scope.row.planCode}}</span>
            </template>
          </el-table-column>
     

        </el-table> cellclick(row, column, cell, event){ if(column.label === '交易編碼'){ this.$set(row, 'isOK', true) } if(column.label === '交易名稱'){ this.$set(row, 'isOK2', true) } this.$nextTick(() => { this.$refs.gain.focus() }) }, blurClick({row,column}){ if(column.label === '交易編碼'){ this.$set(row, 'isOK', false) } if(column.label === '交易名稱'){ this.$set(row, 'isOK2', false) } },

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM