-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Catch all route (asterisk route) error when matched path is empty string #3062
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
Comments
Copying the normalized route and passing that to push isn't really valid. Use this instead const newRoute = {
path: this.$route.path,
query: { foo: "bar" }
}; |
Documentation says you can use "named route" when calling Because:
Although:
Needless to say, I would prefer "named route" + |
So @posva isn't this a bug? |
Version
3.1.3
Reproduction link
https://codesandbox.io/s/vue-template-c3dox
Steps to reproduce
Go to https://codesandbox.io/s/vue-template-c3dox
Click on link
go to /anything/123
.Click on button
go to [current url]?foo=bar
.You get to page
/anything/123?foo=bar
- as expected.Now, click on link
go to /anything/
.Click on button
go to [current url]?foo=bar
.You get to page
/?foo=bar
.What is expected?
You should get to page
/anything/?foo=bar
.What is actually happening?
You get to
/?foo=bar
.And console says: "[vue-router] missing param for named route "catchAllRoute": Expected "0" to be defined".
The text was updated successfully, but these errors were encountered: