Skip to content

How to get the domain of the last page in the Vue Router history? #2469

Discussion options

You must be logged in to vote

@HerrNamenlos123 Please try using the following methods to execute different logic based on whether the back has a value:

const router = useRouter()
const goBack = () => {
  const { back } = router.options.history.state

  if (back) {
    router.go(-1)
    return
  }

  // Otherwise, go to other page...
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@HerrNamenlos123
Comment options

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