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

Router-view plus key attribute causes keepAlive to fail #557

Closed
anncwb opened this issue Oct 27, 2020 · 7 comments
Closed

Router-view plus key attribute causes keepAlive to fail #557

anncwb opened this issue Oct 27, 2020 · 7 comments

Comments

@anncwb
Copy link

anncwb commented Oct 27, 2020

Version

4.0.0-rc.1

Reproduction link

https://codesandbox.io/s/vue-router-next-beforerouteupdate-forked-od2y4?file=/index.html

Steps to reproduce

Delete :key="$route.path" and it works

I saw the (#444) problem, and added: key="$route.path". But it will cause keepAlive to fail. This is very important to me, is there any way to deal with it

What is expected?

When router-view is keyed, keepalive is used normally

What is actually happening?

When router-view is keyed, keepalive you can use it normally

@posva
Copy link
Member

posva commented Oct 27, 2020

What does rt mean?

@anncwb
Copy link
Author

anncwb commented Oct 27, 2020

Sorry I wrote it habitually。It has been modified

@posva
Copy link
Member

posva commented Oct 27, 2020

You need to put the key on the component if you are using v slot

@posva posva closed this as completed Oct 27, 2020
@anncwb
Copy link
Author

anncwb commented Oct 27, 2020

@posva I modified the example because I forgot to add the transition tag. It can work before transition without adding mode="out-in". It won't work after adding

@anncwb
Copy link
Author

anncwb commented Oct 27, 2020

When I switch routes, the page does not render. I mentioned this question in vue-next before, but I am not sure why this problem occurred

@anncwb
Copy link
Author

anncwb commented Oct 27, 2020

can you help me?

@posva
Copy link
Member

posva commented Oct 27, 2020

There is no includes prop in keep alive, but I don't understand why it breaks with it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants