alibaba-fusion / next

🦍 A configurable component library for web built on React.
https://fusion.design
MIT License
4.58k stars 584 forks source link

[Tree]Tree组件在切换数据后,属性定义defaultExpandAll={true}会失效,建议增加受控状态下的expandAll #2660

Open Patrick9527 opened 3 years ago

Patrick9527 commented 3 years ago

Component

Tree

Feature Description

Tree组件在切换数据后,属性定义defaultExpandAll={true}会失效,建议增加受控状态下的expandAll riddle复现demo https://riddle.alibaba-inc.com/riddles/433f2ce7

YSMJ1994 commented 7 months ago

defaultExpandAll 行为类似 defaultValue,仅在组件首次渲染会执行,你的场景可以在数据变化时传递一个不同的 key 让 react 渲染一个新的组件来实现。 若有受控的expandAll,会阻塞用户交互,可以通过传递 expandedKeys 来达到类似效果