Skip to content
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 title 变化,同时 destroyOnClose 为 true,导致重复 mount 和 destroy #152

Closed
1 task done
bq-hentai opened this issue Sep 2, 2018 · 5 comments
Closed
1 task done

Comments

@bq-hentai
Copy link

bq-hentai commented Sep 2, 2018

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

1.0.3

Environment

Win7/vue 2.5

Reproduction link

Edit on CodeSandbox

Steps to reproduce

1、点击取消关闭弹窗
2、点击ok按钮打开弹窗,再点击取消关闭弹窗
3、看console日志

What is expected?

不会重新执行mount和destroy

What is actually happening?

重复Mount以及destroy。

@tangjinzhou
Copy link
Member

image
destroyOnClose=true就是干这个事的啊

@bq-hentai
Copy link
Author

感谢回复 @tangjinzhou

请看 栗子 并按照操作走。

开始初始打开页面,默认打开弹窗,会出现两个 mount,Console截图:
image

然后取消关闭弹窗,会有两个destroy(这个是beforeDestroy hook打印的,所以顺序和destroy相反),console截图:
image

再次打开弹窗,会有两个 mount,Console 截图:
image

最后点击确定,应该是两个destroy,但是并不是,多了mount 和 destroy,看截图:
image

另外,更直观的可以看 这个栗子,直接点击打开和确定,然后看 Console。

@tangjinzhou
Copy link
Member

下个版本修复,临时解决方案:close时不要更改title,或 title不要在非空之间切换

@tangjinzhou
Copy link
Member

please update to 1.1.0

@lock
Copy link

lock bot commented Sep 11, 2019

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.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants