fix(amis-ui): 修复collapse-group组件特性动作/收起 执行异常问题

This commit is contained in:
wibetter 2023-12-10 00:51:55 +08:00
parent 2ae514474f
commit 8aac5c078f

View File

@ -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)
});
});
};