useRoute didnt update
gyxoBka opened this issue · comments
Environment
- Operating System: Linux
- Node Version: v18.18.0
- Nuxt Version: 3.11.2
- CLI Version: 3.11.1
- Nitro Version: 2.9.6
- Package Manager: npm@10.2.3
- Builder: -
- User Config: devtools, modules, pinia
- Runtime Modules: @pinia/nuxt@0.5.1
- Build Modules: -
Reproduction
Describe the bug
-
Go to Other page id 1
You'll see that all id's are 1 -
Then go to Main Page
3.Then go to Other page id 2
You'll see that all id's are 2 except first. Location Outside wiill be still 1
it is updated only when declaring a variable inside the method during auto-import or when importing from vue-router
Additional context
No response
Logs
No response
Start a new pull request in StackBlitz Codeflow.
Hello 👋,
you can use const route = useRouter().currentRoute.value;
to get reactive route object.
Hello 👋, you can use
const route = useRouter().currentRoute.value;
to get reactive route object.
Hello! Thank you a lot! It actually works. However, I don't think this is the solution to the useRoute problem