nuxt / nuxt

The Intuitive Vue Framework.

Home Page:https://nuxt.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

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

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