suwu150 / react-native-tree-select

react-native-tree-select组件树形结构选择
https://www.npmjs.com/package/react-native-tree-select
MIT License
67 stars 28 forks source link

要如何默认进来全部展开树呢? #1

Closed lingliMr closed 5 years ago

lingliMr commented 6 years ago

suwu150 commented 6 years ago

暂时不支持默认打开,再后续会设计

lingliMr commented 6 years ago

@suwu150 我看了下 91行这样改下就默认展开了。 const isOpen = !(this.state.nodesStatus && this.state.nodesStatus.get(item && item.id))||false;

suwu150 commented 6 years ago

你是把false改成true了吗?

lingliMr commented 6 years ago

@suwu150 false 肯定不该呀 前面加了取反 默认进来就展开了。 更好的应该是可以提一个变量出来,来控制默认是不是展开状态。

suwu150 commented 6 years ago

也对,你这想法可以啊

suwu150 commented 6 years ago

通过传递isOpen可以默认打开了