上代码:

<el-table
   :data="tableData"
    height //表头固定
    style="width: 100%">
        <el-table-column :label=title[key] v-for="(item,key) in title" :key="key">
          <el-table-column
            label="合格"
            class-name="normal-color">
            <template slot-scope="scope">
              {{scope.row[key*2]}}
            </template>
          </el-table-column>
          <el-table-column
            prop="name"
            label="不合格"
            class-name="red-color">
            <template slot-scope="scope">
              {{scope.row[(key*2+1)]}}
            </template>
          </el-table-column>
        </el-table-column>
</el-table>
export default {
   data() {
      return {
      	title:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月"],
      	tableData:[
      		name:'1',
      		list:[3,5,1,2,6,3,4,5,7,8,9,5,4,1,2,3,6,5,4,1]
      	]
      }
   },

酱酱~ 成啦~
在这里插入图片描述

Logo

前往低代码交流专区

更多推荐