-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Async components are lost from $refs after a state update #3188
Comments
Note you should be using |
When using the template ref on async component: <AsyncComp ref="myRef" /> This Therefor, this PR makes the inner component completely take over the template ref forwarded from the async component |
@HcySunYang I've pulled your branch into my project and it seems to be fixing my original issue. |
I think the fix is not yet included in 3.0.7 according to the changelog. |
Sorry, I seem to have responded to a deleted comment. |
Yes, it was merged after 3.0.7 and will be part of 3.0.8 |
Version
3.0.5
Reproduction link
https://codepen.io/gfeher/pen/VwmaRVq
Steps to reproduce
Click on the "click me!" button two or more times.
What is expected?
After the first click, the following message should appear:
After the second and subsequent clicks, the message should stay the same as above.
What is actually happening?
After the first click, the message is as it's expected. However, after the second and subsequent clicks, it changes to the following:
I am looking into migration from Vue 2 to Vue 3: in the real life code in which I have discovered this problem, I was trying to use async imports with webpack instead of the promise-based hack in the codepen. It was like this:
The text was updated successfully, but these errors were encountered: