1、找到index.html。

2、找到main.js

3、掛載了router,然后去找router下的index.js

index.js中,指定了路由。如:
path: '/index',就會根據 import Index from '@/components/Index' 去components下找Index組件
4.根據index.js中掛載的組件路徑(如:path: '/index',),去找相應的組件。然后在App.vue顯示。

<router-link to="/index">首頁</router-link>,根據路由做了鏈接,點擊首頁,就會跳到/index路徑下
5.輸入命令npm run dev,啟動前端vue。
在瀏覽器地址欄輸入:http://127.0.0.1:8080/index
注意:在index.js中的routes列表之后,加上 mode: 'history',否則路徑應該是:http://127.0.0.1:8080/#/index

