-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
ability to check push vs replace in navigation guard #1620
Comments
Features are also needed in beforeEach. |
As many +1's as I can give. |
When you have a navigation guard that needs to stick on a part on the URL, no matter if it's a push or replace, this becomes very hard to do transparently. If we follow @posva's suggestion, suddenly all locations that use a replace also need to pass on another navigation prop, to indicate that this was a replace to the navigation guards. This seems to be the only way for our navigation guard |
issue vuejs#1620 pull request vuejs#1906
issue vuejs#1620 pull request vuejs#1906
issue vuejs#1620 pull request vuejs#1906
What problem does this feature solve?
I am trying to create a single page mobile app with a push/pop/modal navigation. This navigation behavior is similar to the iOS SDK's navigation controller behavior.
To get this to work in my code I have added a new field(navigationType: push | pop | modal) in the params object. Then in router.afterEach I check for this new field.
It would be nice to have this be part of the vue router api. Considering the push/replace is already separate API.
What does the proposed API look like?
usage might be:
router.afterEach((to, from) => {
if(to.navigationType == 'push'){
} else if(to.navigationType == 'replace'){
}
}
The text was updated successfully, but these errors were encountered: