<el-table-column v-for="(column, index) in tableConfig"
:key="index"
:prop="column.prop"
:label="column.label"
:width="column.width?column.width:undefined"
:min-width="column.minWidth"
:fixed="column.fixed"
:show-overflow-tooltip="true"
>
<template slot-scope="scope" v-if="!column.type">
<el-checkbox :value="scope.row[column.prop]==1"></el-checkbox>
</template>
</el-table-column>
如上面代码会导致表格数据不显示
修改为如下代码,则正常显示
<template v-for="(column, index) in tableConfig">
<el-table-column
:key="index"
:prop="column.prop"
:label="column.label"
:width="column.width?column.width:undefined"
:min-width="column.minWidth"
:fixed="column.fixed"
:show-overflow-tooltip="true" v-if="!column.type"
></el-table-column>
<el-table-column
:key="index"
:prop="column.prop"
:label="column.label"
:width="column.width?column.width:undefined"
:min-width="column.minWidth"
:fixed="column.fixed"
:show-overflow-tooltip="true" v-if="column.type=='checkbox'"
>
<template slot-scope="scope" >
<el-checkbox :value="scope.row[column.prop]==1"></el-checkbox>
</template>
</el-table-column>
</template>
如有其他方案,欢迎评论区交流