React Sortable Tree:默认展开每个节点



对于我的react项目,我使用的是react-sortable-tree

但我想念的选项默认展开的所有节点。

有办法实现这个目标吗?

编辑:

expand = {true}

toggleExpandedForAll ={真}

不工作

好的,所以答案不是将这些选项作为道具添加到组件中,而是将它们添加到您想要解析它的数据树中…

const flatData = dataTreeFrom2.map((node) => ({
...node,
title: node.limitGroupName,
expanded:true,
className: ""
}));

最新更新