feat:vue-element-admin升级改造vue3

This commit is contained in:
有来技术
2021-11-21 23:38:54 +08:00
parent 0091a5fab2
commit fe8a7e2c31
25 changed files with 1463 additions and 164 deletions

View File

@@ -1,13 +1,35 @@
import {createRouter, createWebHashHistory, RouteRecordRaw} from 'vue-router'
import Layout from '@/layout/index.vue'
const routes: Array<RouteRecordRaw> = [
export const constantRoutes: Array<RouteRecordRaw> = [
{
path: '/redirect',
component: Layout,
meta: {hidden: true},
children: [
{
path: '/redirect/:path(.*)',
component: () => import('@/views/redirect/index.vue')
}
]
},
{
path: '/login',
name: 'Login',
component: () => import('@views/login/index.vue'),
component: () => import('@/views/login/index.vue'),
meta: {title: '登录'}
}, {
},
{
path: '/404',
component: () => import('@/views/error-page/404.vue'),
meta: {hidden: true}
},
{
path: '/401',
component: () => import('@/views/error-page/401.vue'),
meta: {hidden: true}
},
{
path: '/',
component: Layout,
redirect: '/dashboard',
@@ -22,9 +44,15 @@ const routes: Array<RouteRecordRaw> = [
}
]
const router = createRouter({
history: createWebHashHistory(),
routes: routes
routes: constantRoutes
})
export function resetRouter() {
const newRouter = router;
(router as any).matcher = (newRouter as any).matcher
}
export default router