el-table列中嵌套列

<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>

在列表中再嵌套el-table-column就行了

posted @ 2020-05-09 09:36  舞之欣  阅读(2332)  评论(1)    收藏  举报