-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
多层组件嵌套 ,如何通过最底层的组件动态操作组件的挂载与卸载 #1085
Comments
我觉的应该是在使用 Filter 的地方决定 {
isShow && <Filter
visible={this.props.visible}
onCancel={this.onCancel}
onOk={this.onOk}
>
<FilterItem label='搜索'>
<Search
placeholder='请输入姓名'
onChange={this.onSearch}
/>
</FilterItem>
<FilterItem label='状态'>
<FilterStatus onChange={this.onStatusChange} />
</FilterItem>
</Filter>
} |
这样做动画逻辑就不能复用了 |
只能通过这种逻辑判断决定某一元素是否挂载与卸载,所以就看这个判断条件你要写在哪里了 |
是的 |
@luckyadam react 的 render props 写法是否还不支持? |
暂时还不支持~ 正在加紧开发中 |
@youngluo render props 功能可以新提一个 feature request 的 issue,方便追踪 |
@luckyadam 行,目前这个有什么替代方案吗 |
只能传参进入组件,在组件里处理了 |
👌 |
@luckyadam 感谢 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
问题描述
打包后,页面中 Filter 组件不显示的渲染结果
Filter 组件显示的渲染结果
像这样的多层组件嵌套 ,如何通过最底层的 Mask 组件的 visible prop 来做到动态操作组件的挂载与卸载;
目前可以控制组件的显示隐藏,但是数据状态会被保留下来
系统信息
The text was updated successfully, but these errors were encountered: