DevBox/src/router/index.ts

59 lines
1.5 KiB
TypeScript

import { createRouter, createWebHistory } from "vue-router"
const routes = [
{
path: "/",
redirect: "/login",
},
{
path: "/login",
name: "Login",
component: () => import("@/views/home/Login.vue"),
},
{
path: "/home",
name: "Home",
component: () => import("@/layout/Index.vue"),
redirect: "/dashboard",
children: [
{
path: "/dashboard",
name: "Dashboard",
meta: { title: "工作台", icon: "GridOutline", tabFixed: true },
component: () => import("@/views/dashboard/Dashboard.vue"),
},
{
path: "/system/users",
name: "SysUser",
meta: { title: "用户管理", icon: "PeopleOutline", tabFixed: true },
component: () => import("@/views/system/SysUser.vue"),
},
{
path: "/system/roles",
name: "SysRole",
meta: { title: "角色管理", icon: "ShieldOutline", tabFixed: true },
component: () => import("@/views/system/SysRole.vue"),
},
{
path: "/system/menus",
name: "SysMenu",
meta: { title: "菜单管理", icon: "MenuOutline", tabFixed: true },
component: () => import("@/views/system/SysMenu.vue"),
},
{
path: "/profile",
name: "Profile",
meta: { title: "个人中心", icon: "PersonOutline", tabFixed: true },
component: () => import("@/views/system/Profile.vue"),
},
],
},
]
const router = createRouter({
history: createWebHistory(),
routes,
})
export default router