Skip to content

Commit

Permalink
feat: baidu#11604 InputTree折叠状态保持
Browse files Browse the repository at this point in the history
  • Loading branch information
chenwenhao committed Feb 18, 2025
1 parent 884a816 commit 1075c58
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/amis-core/src/utils/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,8 @@ export function filterTree<T extends TreeItem>(
: undefined;

if (Array.isArray(children) && Array.isArray(item.children)) {
item = {...item, children: children};
// issue#11604 不能改变item的引用,Tree组件折叠/展开状态保持会用到
item.children = children;
}

return item as T;
Expand All @@ -1145,7 +1146,8 @@ export function filterTree<T extends TreeItem>(
);

if (Array.isArray(children) && Array.isArray(item.children)) {
item = {...item, children: children};
// issue#11604 不能改变item的引用,Tree组件折叠/展开状态保持会用到
item.children = children;
}
}
return item as T;
Expand Down

0 comments on commit 1075c58

Please sign in to comment.