mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-16 06:03:42 +08:00
feat(ui): 管理后台基础配置
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
import HomeView from '../views/HomeView.vue'
|
||||
import CustomLayout from '@/components/CustomLayout.vue'
|
||||
import menu from './menu'
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
@@ -7,16 +8,15 @@ const router = createRouter({
|
||||
{
|
||||
path: '/',
|
||||
name: 'home',
|
||||
component: HomeView
|
||||
component: CustomLayout,
|
||||
redirect: () => menu[0].path,
|
||||
children: menu
|
||||
},
|
||||
{
|
||||
path: '/about',
|
||||
name: 'about',
|
||||
// route level code-splitting
|
||||
// this generates a separate chunk (About.[hash].js) for this route
|
||||
// which is lazy-loaded when the route is visited.
|
||||
component: () => import('../views/AboutView.vue')
|
||||
}
|
||||
path: "/:pathMatch(.*)*",
|
||||
name: "404",
|
||||
component: () => import("@/views/NotFound.vue"),
|
||||
},
|
||||
]
|
||||
})
|
||||
|
||||
|
||||
27
gpt-vue/projects/vue-admin/src/router/menu.ts
Normal file
27
gpt-vue/projects/vue-admin/src/router/menu.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import {
|
||||
IconUser,
|
||||
IconDashboard
|
||||
} from "@arco-design/web-vue/es/icon";
|
||||
|
||||
const menu = [
|
||||
{
|
||||
path: '/dashboard',
|
||||
name: 'Dashboard',
|
||||
meta: {
|
||||
title: "仪表盘",
|
||||
icon: IconDashboard
|
||||
},
|
||||
component: () => import('@/views/DashboardView.vue')
|
||||
},
|
||||
{
|
||||
path: '/user',
|
||||
name: 'User',
|
||||
meta: {
|
||||
title: "用户管理",
|
||||
icon: IconUser,
|
||||
},
|
||||
component: () => import('@/views/User/UserContainer.vue')
|
||||
},
|
||||
];
|
||||
|
||||
export default menu;
|
||||
Reference in New Issue
Block a user