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