1. Step1: Create a. Vue file
2. Step2 build routes.
3. Set up a route forward.
In the created Routers, Path is configured with routing paths and Component is configured with mapped components
Note that export default routers must be written at the bottom of the file and must be followed by an empty line. Otherwise, the export default Routers cannot pass ESlint authentication. To implement route nesting, add children to the configured route and a secondary route to children. When configuring a path, nested paths starting with “/” are regarded as the root path. Therefore, there is no need to add “/” to the path of child routes
Adding dynamic parameters to routes:
If you want to use the home component for rendering for all users with different ids, you can add dynamic parameters to the phones.js interface:
{path: ‘/home/:id’, component: home} So that “/home/user01”, “/home/user02”, “/home/user03” and other routes are mapped to the home component. You can then use $route.params.id to get the id
Programmatic navigation
Many buttons also perform a series of methods before performing a jump, which can be used
Copy the code
To modify the URL to complete the jump.