zoukankan      html  css  js  c++  java
  • <el-table>里的数据已经修改了,但是页面不更新

    问题:使用<el-table>里的文本框赋值后,table里是数据不更新

    解决:

     // 页面不更新的解决: 数据转化以下,仅以下两行!!!!!!
            let dataArrTemp = JSON.stringify(this.form.product_bom);
            this.form.product_bom= JSON.parse(dataArrTemp);

    以下自用的

    html部分:
    <el-table-column label="分类" min-width="120">
      <template slot-scope="scope">
        <span v-if="scope.row.name">{{scope.row.name}}</span>
        <el-input
          v-else
          v-model="scope.row.name"
          :disabled="disabled"
          class="pointer"
          @focus="handleMaterielDialogs(scope.row, scope.$index)"
          suffix-icon="el-icon-zoom-in"
        ></el-input>
      </template>
    </el-table-column>
    
    js:部分
    
            // 获取到index
            handleMaterielDialogs(row, index) {
                  this.thatRowIndex = index;
            },
    
            // 值带页面上
            this.form.bom[this.thatRowIndex] = Object.assign(
              {},
              this.activeList3[0],
              { count: this.form.bom[this.thatRowIndex].count * 1 }
            );
    
    
            // 页面不更新的解决: 数据转化以下,仅以下两行!!!!!!
            let dataArrTemp = JSON.stringify(this.form.bom);
            this.form.bom= JSON.parse(dataArrTemp);                
    View Code
  • 相关阅读:
    jekins构建自动化项目的步骤
    CRT 和mysql 中文乱码解决方式
    Jenkins的配置(rpm red hat方式)
    MapReduce job.setNumReduceTasks(0)思考
    浏览器angent分析工具
    npm中的 --save-dev
    computed与methods的异同
    JS函数种类详解
    Vue.js和Nodejs的关系
    AJAX复习笔记
  • 原文地址:https://www.cnblogs.com/wangduojing/p/14329128.html
Copyright © 2011-2022 走看看