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

[Bug report] Route path is not correct when navigating #1249

Closed
Mister-Hope opened this issue Feb 3, 2023 · 2 comments
Closed

[Bug report] Route path is not correct when navigating #1249

Mister-Hope opened this issue Feb 3, 2023 · 2 comments
Assignees
Labels
bug Something isn't working package:client

Comments

@Mister-Hope
Copy link
Member

Mister-Hope commented Feb 3, 2023

Description

When accessing route.path at onMounted lifecycle, the value is the previous page, and this is not an expected behavior:

  • watcher for route will be triggered unexpected
  • a component will initialized with a route path it doesnot belong to

A normal vue app is working as expected: https://stackblitz.com/edit/vitejs-vite-ssyfup?file=src%2Fcomponents%2FB.vue,src%2Fcomponents%2FC.vue,src%2Fcomponents%2FHome.vue&terminal=dev

Reproduction

https://stackblitz.com/edit/vuepress-ewt9uy?file=docs%2Fguide%2FREADME.md

Used Package Manager

npm

System Info

Not needed
@Mister-Hope Mister-Hope added the bug Something isn't working label Feb 3, 2023
@Mister-Hope
Copy link
Member Author

Mister-Hope commented Mar 2, 2023

@meteorlxy I found further issue with this. Besides route.path has a delay with page change,

When navigating from different layout, the route path initial value will be undefined, then to old value , then to new value

E.g.:

when navigating from / (layout: Home) to /test (layout: Page)

Layout Page is watching route.path, then it will be trigger twice:

  • undefined to /
  • / to /test

Can we fix ASAP?

@Mister-Hope
Copy link
Member Author

Mister-Hope commented Apr 28, 2023

@meteorlxy Any suggestions on this one? I have made plenty of related workaround.

This mainly breaks any feature related with route path and query

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working package:client
Projects
None yet
Development

No branches or pull requests

2 participants