Skip to content

How to Reset Filters with Query Params Without Triggering Navigation Guard Loops? #2436

Closed Answered by posva
loic-bellinger asked this question in Help and Questions
Discussion options

You must be logged in to vote

Since you are in a navigation guard, you can trigger a redirect:

router.beforeEach(async (to, from) => {
  if (from.name && to.name !== from.name && to.name === 'dashboard' && !to.redirectedFrom) {
    return { ...to, query: {} }
  }
})

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@loic-bellinger
Comment options

@posva
Comment options

@loic-bellinger
Comment options

@posva
Comment options

Answer selected by loic-bellinger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants