Hi, I’m a student who is brand new to Vue and pretty new to programming in general. I’m sorry if this is a dumb question but please be patient with me. I’ve never used anything like this before. I’m trying to figure out conceptually how something would work.
My question is, can you pass information like a variable from one route to another?
Let me explain what’s going on in my project. Hopefully it’ll make sense.
I have a component that is called App and inside I have a router-view. I have 2 routes, Home and Books
There is a navigation component with links so you can move between them.
On Books, there are buttons and you can select different book series. When you click on one of the buttons it updates a variable that says which series is active and shows all the information about that series. By default the same series is active when you first navigate to Books.
On Home there is a story about one of the book series. When you click on the button it navigates to Books. However, it does not show information about that book series. It shows information about the series that is the default. I’m wondering if there is a way that I could update the variable in Books when I click on the button on Home so that I could see the information about that series.
At first I thought maybe I could pass information from Home -> App -> Books
I was thinking I could do $emit to App and then to send props to Books. However because the route is changing I don’t think that’ll work/I don’t know how to do that. Is there any way to send data between Home and Books? Any resources/examples/explanations would be really appreciated!
Thanks for your help!