import {createRouter,createWebHistory,createWebHashHistory} from 'vue-router'; // 1.引入页面路径 import Home from '@/views/Home.vue'; import List from '@/views/List.vue'; import My from '@/views/My.vue'; const router = createRouter({ // 当前路由的模式 history:createWebHashHistory(), routes:[ // 当前项目匹配的路由 // 2.匹配路由 { path:'/home', component: Home, }, { path:'/list', component: List, }, { path:'/my', component: My, }, ] }) export default router;