You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.2 KiB
39 lines
1.2 KiB
2 years ago
|
import { Component } from 'vue';
|
||
|
import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';
|
||
|
import { Document, Tools, UserFilled, Operation } from '@element-plus/icons-vue';
|
||
|
import Layout from '@/layout/index.vue';
|
||
|
|
||
|
declare module 'vue-router' {
|
||
|
interface RouteMeta {
|
||
|
hidden?: boolean;
|
||
|
title?: string;
|
||
|
icon?: Component;
|
||
|
requiresPermission?: string;
|
||
|
}
|
||
|
}
|
||
|
export const routes: Array<RouteRecordRaw> = [
|
||
|
// { path: '/login', component: () => import('@/views/Login.vue'), meta: { hidden: true } },
|
||
|
{ path: '/404', component: () => import('@/views/404.vue'), meta: { hidden: true } },
|
||
|
{ path: '/403', component: () => import('@/views/403.vue'), meta: { hidden: true } },
|
||
|
{
|
||
|
path: '',
|
||
|
component: Layout,
|
||
|
meta: { hidden: true },
|
||
|
children: [{ path: '', component: () => import('@/views/Home.vue'), meta: { title: 'menu.home', requiresPermission: 'auth' } }],
|
||
|
},
|
||
|
// 404 page must be placed at the end !!!
|
||
|
{
|
||
|
path: '/:pathMatch(.*)*',
|
||
|
name: 'not-found',
|
||
|
redirect: '/404',
|
||
|
meta: { hidden: true },
|
||
|
},
|
||
|
];
|
||
|
const router = createRouter({
|
||
|
history: createWebHashHistory(),
|
||
|
scrollBehavior: () => ({ top: 0 }),
|
||
|
routes,
|
||
|
});
|
||
|
|
||
|
export default router;
|