Closed CrimsonFez closed 2 months ago
For anyone else with this issue, I found a work around. Give the 2nd level routerviews each a unique name, then in router.ts set that as the view for your child components.
Duplicate of #626
Some of this behavior is inherent to KeepAlive and how it keeps updating components that are kept alive. Check this Vue playground to give you an idea of the behavior:
Reproduction
https://github.com/CrimsonFez/vuejs-keep-alive-router-bug/
Steps to reproduce the bug
You need to have nested RouterView + KeepAlives like:
App.vue
MyLayoutAndGetter1.vue
MyLayoutAndGetter2.vue
I believe that you also need to pass props through one of the router views, see https://github.com/CrimsonFez/vuejs-keep-alive-router-bug/blob/main/src/views/Person.vue
See my linked repo for full reproduction.
Expected behavior
This should behave like normal, when KeepAlive is not used
Actual behavior
When changing from one nested routerview to the other, it looks like props from the old router view are temporarily attached to the new router view
In my reproduction, this just causes an error, but on my larger app, this causes a crash.
Additional information
No response