element ui 表格可编辑功能


 

 

思路解析:

点击修改,将单元格内改变成输入框格式,点击保存去调取接口

 <!-- 表格主体 -->
          <template slot-scope="scope">
            <span v-if="scope.row.isSet">
              <el-input
                size="large"
                placeholder="请输入内容"
                v-model="scope.row[temTableData.keyList[index]]"
                @input="inputChange($event)"
              >
              </el-input>
            </span>
            <span v-else>{{ scope.row[temTableData.keyList[index]] }}</span>
          </template>


inputChange(e) {  //解决空字符串时 input 不可以输入字段
      this.$forceUpdate();
 },

 


免责声明!

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



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