import { createRouter, createWebHistory } from 'vue-router' export const homeIndex = () => import('@/views/home/index.vue') export const Layout = () => import('@/layout/index.vue') const system = [ { path: '/system/menus', meta: { title: '菜单管理' }, component: () => import('@/views/system/menus/index.vue') }, { path: '/system/role', meta: { title: '角色管理' }, component: () => import('@/views/system/role/index.vue') }, { path: '/system/dict', meta: { title: '字典管理' }, component: () => import('@/views/system/dict/index.vue') }, { path: '/system/dictData', meta: { title: '字典数据管理' }, component: () => import('@/views/system/dictData/index.vue') }, { path: '/system/config', meta: { title: '平台设置' }, component: () => import('@/views/system/config/index.vue') }, { path: '/system/module', meta: { title: '模块设置' }, component: () => import('@/views/system/module/index.vue') } ] const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), routes: [ { path: '/redirect', component: Layout, meta: { hidden: true }, children: [ { path: '/redirect/:path(.*)', component: () => import('@/views/redirect/index.vue') } ] }, { path: '/login', name: 'login', meta: { title: '账号登录' }, component: () => import('@/views/login/index.vue') }, { path: '/', meta: { title: '首页' }, component: Layout, redirect: '/dashboard', children: [ { path: '/', name: 'dashboard', meta: { title: '首页', affix: true, keepAlive: true, alwaysShow: false }, component: () => import('@/views/home/index.vue') }, ...system ] } ] }) export default router