<el-table :data="contents" stripe>
        <el-table-column v-for="(item, index) in contentsTitle" :key="index" :label="item">
          <template scope="scope">
            <span>{{scope.row[index]}}</span>
          </template>
        </el-table-column>
</el-table>

其中,contentsTitle为表头名称,

contents是二元数组,每个scope.row是与contentsTitle对应的字符串数组
如: contentsTitle=['名称','年龄','性别']
     contents = 【
            ['小名','23','男'],
            ['小红','20','女'],
            ['小樱','19','女']

          】

相关文章:

  • 2021-11-28
  • 2022-12-23
  • 2021-12-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-21
  • 2022-12-23
  • 2022-12-23
  • 2021-07-04
  • 2021-12-04
  • 2021-09-27
相关资源
相似解决方案