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

Keep-Alive inside of transition not working with include #5346

Closed
cynecx opened this issue Mar 31, 2017 · 4 comments
Closed

Keep-Alive inside of transition not working with include #5346

cynecx opened this issue Mar 31, 2017 · 4 comments
Labels

Comments

@cynecx
Copy link

cynecx commented Mar 31, 2017

Version

2.2.6

Reproduction link

https://jsfiddle.net/50wL7mdz/24930/

Steps to reproduce

Click the "Switch view" button.

What is expected?

The "home" view's state should have been kept alive when switching to the other signin view.

What is actually happening?

Instead the "home" view is recreated everytime.


If I remove the include="home" option from keep-alive, it works as intended or if I remove the mode="out-in" option from the transition node, it also works as intended.
I've debugged this and it seems that when every time it switches the component, the "include" watch is somehow triggered with undefined as val parameter and then it's being triggered again with the correct "home" value but by then the first trigger has already removed the home node from the cache.

@LinusBorg
Copy link
Member

To make use of the include option, you have to specify the name property for the component(s). This should also be explained in the docs.

@LinusBorg
Copy link
Member

Actually, forget that, it should work...

@posva posva changed the title Keep-Alive doesn't save the state of the slot component Keep-Alive not working with include Apr 1, 2017
@posva
Copy link
Member

posva commented Apr 1, 2017

In the meantime, you can use an exclude with the rest of components as a workaround

@posva posva changed the title Keep-Alive not working with include Keep-Alive inside of transition not working with include Apr 1, 2017
@cynecx
Copy link
Author

cynecx commented Apr 1, 2017

@posva Do you have any idea yet why the cache is being invalidated when I use include?

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

No branches or pull requests

3 participants