with vue3.4 + router4 or above useRoute() or useRouter() will return undefined #2124
-
Reproductionempty Steps to reproduce the bugconst route = useRoute(); Expected behaviorreturn the current routing information Actual behaviorreturn undefined Additional informationNo response |
Beta Was this translation helpful? Give feedback.
Answered by
posva
Jan 30, 2024
Replies: 1 comment
-
|
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
useRoute()
must be used within script setup. It's only undefined when called in the wrong places. BTW, use discussions or the discord chat to ask questions, thanks!