import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router" const staticRoutes: Array = [ { path: '/', name: 'home', component: () => import('/@/views/layout/index.vue'), redirect: '/home', meta: { title: '首页' }, children: [{ path: '/home', name: 'home', component: () => import('/@/views/home/index.vue'), meta: { title: '首页' } }] }, { path: '/login', name: 'login', component: () => import('/@/views/login/index.vue'), meta: { title: '登陆' } }, { path: '/:pathMatch(.*)', redirect: '/' } ] const router = createRouter({ history: createWebHashHistory(), routes: staticRoutes }) export default router