You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the example repo, there are 3 router links that switch between 3 asynchronously loaded route components - Home, About, Contact. Keep-alive is used to wrap the loaded router view components. Each component contains an input bound to an internal state variable in order to establish state changes for each component.
What is expected?
Case 1: Keep-Alive is used without parameters
The state for each component should be maintained between router view changes.
Case 2: Keep-Alive is used with parameter: :include="['about']"
The state for the About component should be maintained between router view changes.
The state for the other 2 components should be reset between router view changes.
Case 3: Keep-Alive is used with parameter: :exclude="['about']"
The state for the About component should be reset between router view changes.
The state for the other 2 components should be maintained between router view changes.
What is actually happening?
Case 1: Works as expected.
Case 2: The state is reset for all components
Case 3: The state is maintained for all components
@hminghe is correct. Somehow I missed The match is checked against the component's name in the vue docs and for some reason I assumed it was using the name of the route.
Vue version
3.2.45
Link to minimal reproduction
https://github.com/DOOMitru/async-components-keep-alive-include
Steps to reproduce
In the example repo, there are 3 router links that switch between 3 asynchronously loaded route components - Home, About, Contact. Keep-alive is used to wrap the loaded router view components. Each component contains an input bound to an internal state variable in order to establish state changes for each component.
What is expected?
Case 1: Keep-Alive is used without parameters
Case 2: Keep-Alive is used with parameter:
:include="['about']"
Case 3: Keep-Alive is used with parameter:
:exclude="['about']"
What is actually happening?
Case 1: Works as expected.
Case 2: The state is reset for all components
Case 3: The state is maintained for all components
System Info
Any additional comments?
This may be related to issue #3529
The text was updated successfully, but these errors were encountered: