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

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

Closed
masquevil opened this issue Dec 3, 2018 · 3 comments

Comments

@masquevil
Copy link

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
}

or:

beforeEach: (to, from, next) => {
  console.log(to.replace)    // true or false
}
@posva
Copy link
Member

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 as completed Dec 3, 2018
@GuoQichen
Copy link

Does this have any solution ? @posva

@iamahuman
Copy link

Duplicate of #1620

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

No branches or pull requests

4 participants