项目啥要求就用啥了呗:
效果图:
<el-table border height="500" style="width: 100%" :data="tableData">
<template v-for="(item, index) in tableHeader">
<el-table-column
:key="index + item"
:prop="item.colName.toString()"
align="center"
width="180"
>
<template slot="header" slot-scope="scope">
<el-checkbox
v-bind:title="item.colName.split('-')[0]"
v-model="item.checked"
@change="selectChange(item, index, scope)"
>{{ item.colName.split('-')[1] }}</el-checkbox
>
</template>
</el-table-column>
</template>
</el-table>
表头和数据: