-
-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
Modal.info、Modal.success、Modal.xxx 可以添加关闭接口嘛? #2110
Comments
同样需要 |
类似 message 和 notification 加上 destory 方法如何。 |
还是 var modal = Modal.info({});
modal.destroy(); |
后者好一点。 |
期待 |
Merged
这种场景下,组件自身没法自动销毁吗? |
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
在 SPA 应用里考虑这样的一个场景:
在当前页面做了某个操作后,触发了
Modal.info
,用来提示一些信息,然后一个不小心点了后退按钮,跳转到另外一页,此时这个 Modal.info 还是存在页面上的,没有被关闭掉。如果
Modal.info
有返回close
接口,那么就可以在触发Modal.info
的组件被销毁时,也将Modal.info
也给关闭掉。另外,看来下源码,如果在/components/modal/confirm.jsx L132前稍微修改,应该就可以满足需求了,如下:
close
函数返回close
方法,并且返回改组件实例The text was updated successfully, but these errors were encountered: