Closed gyxoBka closed 2 months ago
https://stackblitz.com/edit/nuxt-starter-h3pnwf?file=stores%2Flocation.ts
Go to Other page id 1 You'll see that all id's are 1
Then go to Main Page
Then go to Other page id 2 You'll see that all id's are 2 except first. Location Outside wiill be still 1
The query should be updated when router defined outside a method
it is updated only when declaring a variable inside the method during auto-import or when importing from vue-router
No response
This seems related to Nuxt, not pinia. BTW, the inside usage is not correct, useRoute() shouldn't be called within methods (like any composable)
useRoute()
Reproduction
https://stackblitz.com/edit/nuxt-starter-h3pnwf?file=stores%2Flocation.ts
Steps to reproduce the bug
Go to Other page id 1 You'll see that all id's are 1
Then go to Main Page
Then go to Other page id 2 You'll see that all id's are 2 except first. Location Outside wiill be still 1
Expected behavior
The query should be updated when router defined outside a method
Actual behavior
it is updated only when declaring a variable inside the method during auto-import or when importing from vue-router
Additional information
No response