Skip to content

How can you check if there is a previous route with Vue router? #11330

Discussion options

You must be logged in to vote

Checking window.history.length does not work well because the length does not increase in cases where the same component is reused upon transition.

Are you sure you aren't doing anything unconventional? I just tested it and it adds entries to window.history.

Maybe your links are replacing the current location instead of creating a new history entry?

Also, for Vue Router related questions, I suggest to post your questions in Vue Router repo: https://github.com/vuejs/router/discussions

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Masa-Shin
Comment options

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