From b727064362da9f41906b4afa40735d844ae369c1 Mon Sep 17 00:00:00 2001 From: qdzhaoxiaodao <1132468176@qq.com> Date: Sun, 10 Jul 2022 22:18:29 +0800 Subject: [PATCH] =?UTF-8?q?fix(table):=20=E4=BF=AE=E5=A4=8D=E5=8F=AF?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E8=A1=8Ctable=E7=BB=84=E4=BB=B6=EF=BC=8Cdata?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=95=B0=E6=8D=AE=E6=97=B6=EF=BC=8C=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=85=A8=E9=80=89=E6=8C=89=E9=92=AE=E4=BC=9A=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复可选中行table组件,data为空数据时,默认全选按钮会选中的问题 --- src/table/hooks/useRowSelect.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/table/hooks/useRowSelect.tsx b/src/table/hooks/useRowSelect.tsx index 3cadff8a49..e9b04dd495 100644 --- a/src/table/hooks/useRowSelect.tsx +++ b/src/table/hooks/useRowSelect.tsx @@ -62,9 +62,13 @@ export default function useRowSelect(props: TdPrimaryTableProps) { function getSelectedHeader() { const isIndeterminate = intersectionKeys.value.length > 0 && intersectionKeys.value.length < canSelectedRows.value.length; + const isChecked = + intersectionKeys.value.length !== 0 && + canSelectedRows.value.length !== 0 && + intersectionKeys.value.length === canSelectedRows.value.length; return () => (