feat:调整路由

This commit is contained in:
李想 2025-04-24 15:25:18 +08:00
parent 7c749a42ea
commit 86df7d9709
4 changed files with 117 additions and 52 deletions

View File

@ -168,7 +168,7 @@ function handleTitleClick(val) {
width: 30%; width: 30%;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
line-height: 60px; line-height: 90px;
.title_content { .title_content {
position: absolute; position: absolute;
top: 10px; top: 10px;

View File

@ -58,11 +58,14 @@ onMounted(() => {
&-header { &-header {
width: 100%; width: 100%;
height: 60px; height: 60px;
margin-bottom: 60px; // margin-bottom: 60px;
} }
&-main { &-main {
flex: 1; flex: 1;
min-height: calc(100vh - 60px); min-height: calc(100vh - 60px);
} }
.base-laytout-header {
height: 90px;
}
} }
</style> </style>

View File

@ -2,6 +2,8 @@ import { createRouter, createWebHistory } from 'vue-router';
import Layout from '@/layouts/index.vue'; import Layout from '@/layouts/index.vue';
import demoRouters from './modules/demo'; import demoRouters from './modules/demo';
import path from 'path-browserify';
import v2 from './modules/v2';
export const constantRoutes = [ export const constantRoutes = [
// { // {
@ -22,58 +24,59 @@ export const constantRoutes = [
component: Layout, component: Layout,
redirect: '/home', redirect: '/home',
meta: { title: '首页', icon: 'House' }, meta: { title: '首页', icon: 'House' },
children: [ // children: [
{ // {
path: '/home', // path: '/home',
component: () => import('@/views/home/index.vue'), // component: () => import('@/views/home/index.vue'),
name: 'home', // name: 'home',
meta: { title: '首页', icon: 'House' }, // meta: { title: '首页', icon: 'House' },
}, // },
{ // {
path: '/land', // path: '/land',
component: () => import('@/views/land/index.vue'), // component: () => import('@/views/land/index.vue'),
name: 'land', // name: 'land',
meta: { title: '土地资源', icon: 'House' }, // meta: { title: '土地资源', icon: 'House' },
}, // },
{ // {
path: '/inputs', // path: '/inputs',
name: 'inputs', // name: 'inputs',
component: () => import('@/views/inputs/index.vue'), // component: () => import('@/views/inputs/index.vue'),
hidden: true, // hidden: true,
}, // },
{ // {
path: '/entities', // path: '/entities',
name: 'entities', // name: 'entities',
component: () => import('@/views/entities/index.vue'), // component: () => import('@/views/entities/index.vue'),
hidden: true, // hidden: true,
}, // },
{ // {
path: '/breed', // path: '/breed',
name: 'breed', // name: 'breed',
component: () => import('@/views/breed/index.vue'), // component: () => import('@/views/breed/index.vue'),
hidden: true, // hidden: true,
}, // },
{ // {
path: '/plant', // path: '/plant',
name: 'plant', // name: 'plant',
component: () => import('@/views/plant/index.vue'), // component: () => import('@/views/plant/index.vue'),
hidden: true, // hidden: true,
}, // },
{ // {
path: '/trace', // path: '/trace',
name: 'trace', // name: 'trace',
component: () => import('@/views/trace/index.vue'), // component: () => import('@/views/trace/index.vue'),
hidden: true, // hidden: true,
}, // },
{ // {
path: '/early', // path: '/early',
name: 'early', // name: 'early',
component: () => import('@/views/early/index.vue'), // component: () => import('@/views/early/index.vue'),
hidden: true, // hidden: true,
}, // },
], // ],
}, },
...demoRouters, ...demoRouters,
v2,
{ {
path: '/test', path: '/test',
name: 'test', name: 'test',

59
src/router/modules/v2.js Normal file
View File

@ -0,0 +1,59 @@
import Layout from '@/layouts/index.vue';
export default {
path: '/v2',
name: 'layout',
component: Layout,
redirect: '/v2/home',
meta: { title: '首页', icon: 'House' },
children: [
{
path: 'home',
component: () => import('@/views/home/index.vue'),
name: 'home',
meta: { title: '首页', icon: 'House' },
},
{
path: 'land',
component: () => import('@/views/land/index.vue'),
name: 'land',
meta: { title: '土地资源', icon: 'House' },
},
{
path: 'inputs',
name: 'inputs',
component: () => import('@/views/inputs/index.vue'),
hidden: true,
},
{
path: 'entities',
name: 'entities',
component: () => import('@/views/entities/index.vue'),
hidden: true,
},
{
path: 'breed',
name: 'breed',
component: () => import('@/views/breed/index.vue'),
hidden: true,
},
{
path: 'plant',
name: 'plant',
component: () => import('@/views/plant/index.vue'),
hidden: true,
},
{
path: 'trace',
name: 'trace',
component: () => import('@/views/trace/index.vue'),
hidden: true,
},
{
path: 'early',
name: 'early',
component: () => import('@/views/early/index.vue'),
hidden: true,
},
],
};