elementui table 设置动态渲染列,展开同样设置动态列@TOC
<template>
<div class="deduction">
<header>扣款明细</header>
<main>
<el-table :data="tableData" style="width: 100%">
<el-table-column
v-for="(item,index) in tableDataHeader"
:key="index"
:prop="item.prop"
:label="item.col"
>
//这一段 不写 也能动态生成, 但是 实际上, template 是更高级的用法
<template slot-scope="scope">
<!-- {
{scope.row[scope.column.property]}} -->
{
{scope.row}}
{
{scope.column.property}}
<!-- 渲染对应表格里面的内容 -->
</template>
</el-table-column>
</el-table>
</main>