因为使用了虚拟列表,所以需要自定义全选checkbox按钮
重要代码:slot="header" slot-scope="scope"
实现的代码如下:
<el-table-column width="55" align="center">
<template slot="header" slot-scope="scope">
<el-checkbox
v-model="isAllSelected"
@change="handleSelectAll($event)"
:disabled="!tableShowData.length"
></el-checkbox>
</template>
<template slot-scope="scope">
<el-checkbox
v-model="scope.row._isSelected"
@change="handleRowSelect(scope.row, $event)"
></el-checkbox>
</template>
</el-table-column>