Create Vue routes

There are many ways to create a routing module. You can choose the third custom creation when building the scaffolding and then choose whether to create a route, or you can download the routing dependencies yourself and then manually create the routing file. Write it yourself, or my method of creation

1. cmd to enter your own project, then enter vue add router and press Enter, it will automatically create a route for you

vue add router

insert image description here

2. It will ask you whether the router uses history mode? (See what you need), then press Enter

insert image description here

3. After creating it, look at your own project and the routing file will appear, and you will be provided with two routing pages

insert image description here

Guess you like

Origin blog.csdn.net/weixin_48772762/article/details/122811247