-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Passing params via $router.push does not seem to work at all #1679
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
if you specify the |
Thanks for explaining! Can we discuss how to better document this? To me it was not clear from the docs that It should be mentioned in the programmatic navigation section imho. |
Indeed, it's not the first time it happens, I created a PR, make sure to leave any thoughts about it to make sure it's clear 🙂 |
Thanks for your additions, I think they do make clear how 👍 |
Is there a way to pass data from one view to another without injecting it in the URL? I mean, on my Login page I have a flashMessage variable and for some reason other view can use it when redirecting the user to the Login page. But I don't want it changes the URL. Thank you, |
How do you manually add the params? Is there some kind of constructor? |
You must construct the |
|
Version
2.7.0
Reproduction link
balint42@22971e4
Steps to reproduce
First clone the fork through the link I provided and checkout my commit. Run the router examples via
npm run dev
and in the browser (Chrome 64-bit Version 60 Linux) click the first "basic" example. What you will see is that when programmatically navigating to/foobar/...
(happens 2s after mount) the params are missing in the new component being navigated to, when navigating via link they are present.What is expected?
The params passed via
push
should be present in the new component being navigated to as$route.params
and should be passed asprops
.What is actually happening?
The params passed via
push
are not present in the new component being navigated to as$route.params
and are not being passed asprops
.I tried to verify the correct usage by looking at
vue-router/types/test/index.ts
Line 139 in 6f93fc9
https://github.com/vuejs/vue-router/blob/e768e4a9d37b974efaf13388a443706627df6e78/docs/en/essentials/navigation.md
The text was updated successfully, but these errors were encountered: