zoukankan      html  css  js  c++  java
  • 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="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)
            }
          },
  • 相关阅读:
    NOIP simulation
    NOIP2013
    BZOJ 4176 Lucas的数论
    BZOJ 3512 DZY Loves Math IV
    BZOJ 3994 Sum
    BZOJ 4174 tty的求助
    BZOJ 3561 DZY Loves Math VI
    BZOJ 2508 简单题/BZOJ 3775 点和直线
    FTR #1 百步穿杨
    BZOJ 4407 于神之怒加强版
  • 原文地址:https://www.cnblogs.com/javascript9527/p/13840613.html
Copyright © 2011-2022 走看看