feat(ui): 管理后台基础配置

This commit is contained in:
廖彦棋
2024-03-06 10:23:55 +08:00
parent a335b965d0
commit 06fa54fd25
33 changed files with 583 additions and 527 deletions

View File

@@ -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"),
},
]
})

View 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;