col-table使用v-if表头发生宽度变化和其他变化

<el-table-column label="数学" align="center"  :key="Math.random()"  class="table-count">

          <template v-if="task[0]">

            <el-table-column v-for="(item,index) in task[0].calcresult" :key="index"  align="center">

              <template slot="header">{{item.name}}</template>

              <template slot-scope="scope">{{scope.row.calcresult[index].value}}</template>

            </el-table-column>

          </template>

        </el-table-column>

加一个:key="Math.random()"标识唯一值就行啦

posted @ 2020-05-09 09:35  舞之欣  阅读(373)  评论(0)    收藏  举报