Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useRoute didnt update #27199

Open
gyxoBka opened this issue May 13, 2024 · 3 comments
Open

useRoute didnt update #27199

gyxoBka opened this issue May 13, 2024 · 3 comments

Comments

@gyxoBka
Copy link

gyxoBka commented May 13, 2024

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

Stackblitz

Describe the bug

  1. Go to Other page id 1
    You'll see that all id's are 1

  2. 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

Copy link

stackblitz bot commented May 13, 2024

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@jakubednar
Copy link
Contributor

Hello 👋,
you can use const route = useRouter().currentRoute.value; to get reactive route object.

@gyxoBka
Copy link
Author

gyxoBka commented May 14, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants