Two ways to pass data to routing components:
1. Component link
2. router-view props
1. Component link
1.1 General steps
Define the component (the component that stores the message) --> Register the route of this component (register under the corresponding parent component route in the router) --> Write the corresponding label in the parent component route (router-link router-view) - > Make an ajax request in the component that stores the message (if you need to simulate ajax request, you can use the setTimeout timer)
. View details: link: router project .
1.2 Page icon
1.3 New knowledge
In the routing component, there will be a routing object $route, and there will be many attributes under this object (will be explained in detail in the future)
2. router-view props
2.1 Step diagram
①
②
2.2 Attention
Without a colon before msg, it is a string.
Before msg, add a colon, then aaa is a variable.
Router project
When using the query parameter, pay attention to two differences from the params parameter: (the following two pictures)