vue-router icon indicating copy to clipboard operation
vue-router copied to clipboard

backport navigation guard return values

Open 1593292349 opened this issue 1 year ago • 1 comments

What problem does this feature solve?

being able to return a value in a navigaiton guard:

router.beforeEach(to => {
  if (!user)
  return { name: 'login', query: { redirectTo: to.fullPath } }
})

### What does the proposed API look like?
Like v4. X

<!-- generated by vue-issues. DO NOT REMOVE -->

1593292349 avatar Oct 30 '22 06:10 1593292349

Some features cannot be backported without rewriting big parts of the router. I tried porting back as much as I could in the limited time I have.

If anybody wants to backport the navigation guard return value, that would be nice

posva avatar Nov 11 '22 08:11 posva