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

Inside guards, get to know current navigating is under router.replace or router.push. #2515

masquevil opened this Issue Dec 3, 2018 · 1 comment


None yet
2 participants

masquevil commented Dec 3, 2018

What problem does this feature solve?

when doing router.replace('url'), next('otherUrl') will cause this navigation become router.push.

when doing router.push('url'), next({..., replace: true}) will cause this navigation become router.replace.

want to know current navigating statue inside guards to solve this problem.

What does the proposed API look like?

beforeEach: (to, from, next, infos) => {
  console.log(info.replace)    // true or false


beforeEach: (to, from, next) => {
  console.log(to.replace)    // true or false

This comment has been minimized.


posva commented Dec 3, 2018

This is intended and it will propably go under the location params to and from instead of an extra argument.
I cannot search for the issue right now but this has been asked before and it's being tracked so closing as a duplicate

@posva posva closed this Dec 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment