surely-vue / surely-table

Performant advanced table component

Home Page:https://www.surely.cool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

对于复选框全选勾选的问题

Tdota2 opened this issue · comments

commented

对STable设置可选择,但是因为一些业务逻辑,导致某些行不能够选择。对于父子结构数据,因父子勾选联动,会导致全选时将不可选择的一起勾选上(猜测可能是勾选了父的默认行为),但当取消全选时,又无法取消不可选择的,导致父同时无法取消(猜测因子被勾选,父也选中),如图
STable全选问题

image
官网示例没有问题的,https://www.surely.cool/doc/selection#row-selection

可以看下示例,如果还有问题,可以提交一个在线示例

commented

image 官网示例没有问题的,https://www.surely.cool/doc/selection#row-selection

可以看下示例,如果还有问题,可以提交一个在线示例

很抱歉没有提供在线示例,在本地写了个demo,还是能复现出来的,只是将数据改为父子结构,且子不允许选择。代码如下:

`
<s-table
:columns="[{ title: ‘名称', dataIndex: 'name' }]"
rowKey="id"
:dataSource="dataSource"
size="small"
:row-selection="rowSelection"
defaultExpandAllRows

<script setup lang="tsx"> const dataSource = ref([ { id: 1, name: '001', children: [{ id: 2, name: '001-1' }] }, { id: 3, name: '002', children: [{ id: 4, name: '002-1' }] }, ]); const rowSelection: STableProps['rowSelection'] = { checkStrictly: false, onChange: (selectedRowKeys: string[], selectedRows: DataType[]) => { console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows); }, getCheckboxProps: (record: DataType) => ({ disabled: record.id === 4, // Column configuration not to be checked }), }; </script>`

尽可能是一个在线示例,实在不方便,那也要提供一个可以直接复制粘贴的完整组件,你这个代码片段都不完整,复制过来也无法运行

commented

尽可能是一个在线示例,实在不方便,那也要提供一个可以直接复制粘贴的完整组件,你这个代码片段都不完整,复制过来也无法运行

已上传代码,您看这样可以吗?
https://github.com/YYDee-0920/STable-test.git

update to 3.0.7