对于复选框全选勾选的问题
Tdota2 opened this issue · comments
官网示例没有问题的,https://www.surely.cool/doc/selection#row-selection
可以看下示例,如果还有问题,可以提交一个在线示例
官网示例没有问题的,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>`
尽可能是一个在线示例,实在不方便,那也要提供一个可以直接复制粘贴的完整组件,你这个代码片段都不完整,复制过来也无法运行
尽可能是一个在线示例,实在不方便,那也要提供一个可以直接复制粘贴的完整组件,你这个代码片段都不完整,复制过来也无法运行
已上传代码,您看这样可以吗?
https://github.com/YYDee-0920/STable-test.git
update to 3.0.7