Activated hook is not triggering when mounting childs of an async component
Vue version
3.2.45
Link to minimal reproduction
Steps to reproduce
- Enter the playground
- Use the buttons to navigate between async components
What is expected?
Child.vue being a child component of Parent.vue would trigger onActivated hook when mounted. following the docs: https://vuejs.org/guide/built-ins/keep-alive.html#lifecycle-of-cached-instance
What is actually happening?
Child component starts triggering onActivated after the initial mount
System Info
No response
Any additional comments?
No response
@dbssman Is this resolved on your side? Is there a temp workaround for this? Thanks.
I noticed there's a PR waiting approval. Is there anyone can look into it? @zhangzhonghe Any luck with getting the PR reviewed and released? Thanks.
I'm experiencing the same thing. And I can recreated this bug in SFC Playground too.
In my playground, the first time you open it, the child component inside the async comp is mounted but never triggering the activated hook. That's the first time the async comp is loaded. But if you click on the toggle button, I can see the child component inside the async comp is triggering activated.
Any luck with getting the PR reviewed and released? Thanks.
@yxchai You could leave a comment in #7286 and @yyx990803 to review it. Maybe it will get yyx's attention.
@dbssman Is this resolved on your side? Is there a temp workaround for this? Thanks.
@yxchai I have a workaround but very specific to my project and that might not work for you, or not be what you need, If you're still interested in it lemme know.
@yxchai I have a workaround but very specific to my project and that might not work for you, or not be what you need, If you're still interested in it lemme know.
Thanks for the reply, @dbssman, I was able to work out a way in my project specifically. So, all good here.
This bug affected me unexpectedly today. I assume bandwidth just isn't there to get this reviewed and pushed. Just commenting to keep this thread alive!