60 lines
1.4 KiB
JavaScript
60 lines
1.4 KiB
JavaScript
import { createRouter, createWebHistory } from 'vue-router';
|
|
import Layout from '@/layouts/index.vue';
|
|
|
|
import demoRouters from './modules/demo';
|
|
import v2 from './modules/v2';
|
|
|
|
export const constantRoutes = [
|
|
// {
|
|
// path: '/404',
|
|
// name: '404',
|
|
// component: () => import('@/views/error/404.vue'),
|
|
// hidden: true,
|
|
// },
|
|
{
|
|
path: '/new-digital-agriculture-screen/403',
|
|
name: '403',
|
|
component: () => import('@/views/error/403.vue'),
|
|
hidden: true,
|
|
},
|
|
{
|
|
path: '/new-digital-agriculture-screen',
|
|
name: 'layout',
|
|
component: Layout,
|
|
redirect: '/new-digital-agriculture-screen/v2/home',
|
|
meta: { title: '首页', icon: 'House' },
|
|
children: [
|
|
{
|
|
path: '/new-digital-agriculture-screen/v2/home',
|
|
component: () => import('@/views/home/index.vue'),
|
|
name: 'home',
|
|
meta: { title: '首页', icon: '' },
|
|
},
|
|
],
|
|
},
|
|
// ...demoRouters,
|
|
v2,
|
|
// {
|
|
// path: '/test',
|
|
// name: 'test',
|
|
// component: () => import('@/views/test/index.vue'),
|
|
// hidden: true,
|
|
// },
|
|
];
|
|
|
|
/**
|
|
* @Title notFoundRouter(找不到路由)
|
|
*/
|
|
export const notFoundRouter = {
|
|
path: '/new-digital-agriculture-screen/:pathMatch(.*)',
|
|
name: 'notFound',
|
|
redirect: '/new-digital-agriculture-screen/404',
|
|
};
|
|
|
|
const router = createRouter({
|
|
history: createWebHistory(),
|
|
routes: constantRoutes,
|
|
});
|
|
|
|
export default router;
|