-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Description
Version
3.0.3
Reproduction link
https://codesandbox.io/s/y32jkmjr7v
Steps to reproduce
Using vue and vue-router, create a route that requires a component (componentAsync) that is async loaded from the main component (componentApp).
Do something that uses router.push or router.go inside of mounted()
of the componentApp without a path or name.
For example, router.push({query: { test: 'foo' }})
The redirected route will just use path: '/' instead of the actual path you used to initially hit the page.
For example, if you hit domain.com/about
, you will wind up at domain.com/?test=foo
, instead of domain.com/about?test=foo
What is expected?
vue-router would use the current window location
What is actually happening?
vue-router is using /
This is because the async component makes the confirmTransaction callback take longer than the mounted() call to router.push, so the route inside router is still the one with the wrong path.