From 8aac5c078ff3f98a4d5bb4986883c048e64d2b45 Mon Sep 17 00:00:00 2001 From: wibetter <365533093@qq.com> Date: Sun, 10 Dec 2023 00:51:55 +0800 Subject: [PATCH] =?UTF-8?q?fix(amis-ui):=20=E4=BF=AE=E5=A4=8Dcollapse-grou?= =?UTF-8?q?p=E7=BB=84=E4=BB=B6=E7=89=B9=E6=80=A7=E5=8A=A8=E4=BD=9C/?= =?UTF-8?q?=E6=94=B6=E8=B5=B7=20=E6=89=A7=E8=A1=8C=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/amis-ui/src/components/CollapseGroup.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/amis-ui/src/components/CollapseGroup.tsx b/packages/amis-ui/src/components/CollapseGroup.tsx index 404f802da..cdd96d615 100644 --- a/packages/amis-ui/src/components/CollapseGroup.tsx +++ b/packages/amis-ui/src/components/CollapseGroup.tsx @@ -85,8 +85,8 @@ class CollapseGroup extends React.Component< collapseChange(collapseId: string, collapsed: boolean) { let activeKeys = this.state.activeKeys.concat(); - if (!collapsed) { - // 开启状态 + if (collapsed) { + // 设置成折叠状态 if (this.props.accordion) { activeKeys = []; } else { @@ -98,6 +98,7 @@ class CollapseGroup extends React.Component< } } } else { + // 展开折叠器 if (this.props.accordion) { activeKeys = [collapseId as string]; } else { @@ -133,7 +134,8 @@ class CollapseGroup extends React.Component< collapsed, expandIcon: this.props.expandIcon, propsUpdate: true, - onCollapse: () => this.collapseChange(collapseId, collapsed) + onCollapse: (item: CollapseItem, collapsed: boolean) => + this.collapseChange(collapseId, collapsed) }); }); };