Skip to content

How to specify back in vue-router? #1637

Closed Answered by posva
yetrun asked this question in Help and Questions
Discussion options

You must be logged in to vote

A back button should be a button because not only there isn't a reliable way to get the back url but also because it's not a link, it's an action that depends on the previous position and should be loaded within the document without allowing other actions like cmd+click:

<button @click="$router.back()">Go back</a>

That's also the reason this kind of behavior doesn't exist in <RouterLink>.

Maybe, in the

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by posva
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1635 on December 18, 2022 09:03.