We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4e0f794 commit 2a1d302Copy full SHA for 2a1d302
src/tree/hooks/useTreeStore.ts
@@ -217,6 +217,19 @@ export default function useTreeStore(state: TypeTreeState) {
217
});
218
219
220
+ watch(refProps.expandAll, (nVal) => {
221
+ if (nVal) {
222
+ const valueList = store
223
+ .getNodes()
224
+ .filter((node) => Array.isArray(node.children) && node.children.length)
225
+ .map((node) => node.value);
226
+ store.setExpanded(valueList);
227
+ } else {
228
+ store.replaceExpanded(prevExpanded);
229
+ prevExpanded = null;
230
+ }
231
+ });
232
+
233
return {
234
store,
235
rebuild,
0 commit comments