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

nested router-view renders incorrect component with wrapping keep-alive at root #2552

Open
zrh122 opened this Issue Dec 25, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@zrh122
Copy link

zrh122 commented Dec 25, 2018

Version

3.0.2

Reproduction link

https://jsfiddle.net/zrh122/vmopsbeh/

Steps to reproduce

  • click index child1
  • click index child2
  • click home
  • click index child1

What is expected?

index child1 component

What is actually happening?

index child2 component

@posva posva added the bug label Dec 25, 2018

@posva

This comment has been minimized.

Copy link
Member

posva commented Dec 25, 2018

Seems to be related to the Wrapper component containing the router-view instead of index.
Adding :key="$route.path" to the root router-view

note to myself: doesn't seem to happen in vanilla Vue: https://jsfiddle.net/u7b4srja/

@posva posva changed the title router-view render incorrect component when kept-alive nested router-view renders incorrect component with wrapping keep-alive at root Dec 25, 2018

@posva posva added has workaround and removed has workaround labels Dec 25, 2018

@zrh122

This comment has been minimized.

Copy link

zrh122 commented Dec 25, 2018

in the forth step, router-view in the Wrapper component renders cached component index child2.
i am thinking this code https://github.com/vuejs/vue-router/blob/v3.0.2/src/components/view.js#L40 caused this problem, the component tree is activated that means inactive should be false but it is true when i debug.

@posva posva added the keep-alive label Dec 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment