Skip to content

How does vue3 get the current page route instance in non-vue file? #1872

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

You must be logged in to vote

useRouter, like other composables, depend on inject() and thus can only be used within setup(). If you are not doing SSR, you can just import the router instance

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 #1871 on June 06, 2023 07:05.