实现方案:通过使用自定义表头的方式手动写一个checkbox,然后设为禁用。
代码:
<el-table
:border="true"
:data="tableData"
>
<el-table-column width="50" align="center">
<template slot="header">
<el-checkbox disabled />
</template>
<template slot-scope="scope">
<el-checkbox />
</template>
</el-table-column>
</el-table>
实现效果如下:


本文介绍了如何在Vue项目中,利用element-ui库自定义表头,实现禁用表格全选按钮的功能。通过编写自定义的checkbox并设置为禁用来达到目的。
673

被折叠的 条评论
为什么被折叠?



