first commit
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router';
|
||||
import { constantRoute } from './routes';
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: constantRoute,
|
||||
});
|
||||
|
||||
export default router;
|
||||
@@ -0,0 +1,35 @@
|
||||
// 对外暴漏配置路由,常量路由
|
||||
export const constantRoute = [
|
||||
{
|
||||
path: '/',
|
||||
component: () => import('@/views/home/index.vue'),
|
||||
name: '首页',
|
||||
meta: {
|
||||
title: '首页',
|
||||
hidden: false,
|
||||
icon: 'HomeFilled',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/404',
|
||||
component: () => import('@/views/404/index.vue'),
|
||||
name: '404',
|
||||
meta: {
|
||||
title: '404',
|
||||
hidden: true,
|
||||
icon: 'DocumentDelete',
|
||||
},
|
||||
},
|
||||
{
|
||||
// 无路由匹配上,重定向到404
|
||||
path: '/:pathMatch(.*)*',
|
||||
redirect: '/404',
|
||||
name: 'any',
|
||||
meta: {
|
||||
title: '404',
|
||||
hidden: true,
|
||||
icon: 'DocumentDelete',
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user