How to specify back in vue-router? #1637
-
What problem does this feature solve?The vue-router can go to any route through specify <a @click="$router.back()"></a> What does the proposed API look like?Does it exist a api like below: <vue-router back></vue-router> |
Beta Was this translation helpful? Give feedback.
Answered by
posva
Dec 18, 2022
Replies: 1 comment
-
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 Maybe, in the |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
posva
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
That's also the reason this kind of behavior doesn't exist in
<RouterLink>
.Maybe, in the