cpp
<el-table v-loading="loading" :data="infoList" show-summary>
<el-table-column v-for="column in columns" :key="column.prop" :label="column.label" :prop="column.prop">
<el-table-column v-for="(item,index) in column.list" :key="index" :label="item.label" :prop="item.prop">
</el-table-column>
</el-table-column>
</el-table>
数据格式
cpp
tableData: [
{
institution: '石家庄',
entrynum:'111',
premium:'201',
list:[
{entrynum:'11',premium:'200',}
]
},
],
columns: [
{ label: '机构', prop: 'institution' },
{ label: '健康险(风险型)',
list:[
{label: '项目数', prop: 'entrynum' },
{label: '保费规模', prop: 'premium' }
]
},
{ label: '健康险(服务型)',
list:[
{label: '项目数', prop: 'entrynum' },
{label: '保费规模', prop: 'premium' }
]
},
{ label: '意外险',
list:[
{label: '项目数', prop: 'entrynum' },
{label: '保费规模', prop: 'premium' }
]
},
{ label: '意健险',
list:[
{label: '项目数', prop: 'entrynum' },
{label: '保费规模', prop: 'premium' }
]
}
],