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

Allow arbitrary mutable state within push()/replace() #3022

Closed
J-Rojas opened this issue Nov 9, 2019 · 1 comment

Comments

@J-Rojas
Copy link

@J-Rojas J-Rojas commented Nov 9, 2019

What problem does this feature solve?

'Meta' allows for assigning immutable properties to a route. However there is a need to push arbitrary app state whenever a route changes to keep track of historical app state at the time of the route change. 'Meta' does not allow for the use of conditional state based on the route history. Currently the implementation uses the HTML5 history API for pushing state changes, but it does not allow the user to pass in arbitrary state that can be accessed again when going backwards in history. Please expose an extra parameter/object property to the API for this purpose.

What does the proposed API look like?

Proposal:

$router.push({ name: 'my-route1', state: { foo: 'bar' } })
$route.state.foo // 'bar'
$router.go(-1)
$route.state.foo // undefined
@posva

This comment has been minimized.

Copy link
Member

@posva posva commented Nov 9, 2019

Duplicate of #2243

@posva posva marked this as a duplicate of #2243 Nov 9, 2019
@posva posva closed this Nov 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.