Commit b24183b4 authored by xinzhedeai's avatar xinzhedeai

add:emptyRouter 访问问题处理

parent 3e2b8acf
<template>
<router-view />
</template>
<script>
export default {
name: "EmptyLayout",
};
</script>
<style scoped>
/* 可以添加一些基础样式 */
html,
body {
margin: 0;
padding: 0;
height: 100%;
overflow: hidden;
}
</style>
\ No newline at end of file
...@@ -4,24 +4,24 @@ ...@@ -4,24 +4,24 @@
class="app-wrapper" class="app-wrapper"
:style="{ '--current-color': theme }" :style="{ '--current-color': theme }"
> >
<!-- <div <div
v-if="device === 'mobile' && sidebar.opened" v-if="device === 'mobile' && sidebar.opened"
class="drawer-bg" class="drawer-bg"
@click="handleClickOutside" @click="handleClickOutside"
/> />
<sidebar v-if="!sidebar.hide" class="sidebar-container" /> --> <sidebar v-if="!sidebar.hide" class="sidebar-container" />
<div <div
:class="{ hasTagsView: needTagsView, sidebarHide: sidebar.hide }" :class="{ hasTagsView: needTagsView, sidebarHide: sidebar.hide }"
class="main-container" class="main-container"
> >
<!-- <div :class="{ 'fixed-header': fixedHeader }"> <div :class="{ 'fixed-header': fixedHeader }">
<navbar /> <navbar />
<tags-view v-if="needTagsView" /> <tags-view v-if="needTagsView" />
</div> --> </div>
<app-main /> <app-main />
<!-- <right-panel> <right-panel>
<settings/> <settings />
</right-panel> --> </right-panel>
</div> </div>
</div> </div>
</template> </template>
...@@ -119,8 +119,4 @@ export default { ...@@ -119,8 +119,4 @@ export default {
.mobile .fixed-header { .mobile .fixed-header {
width: 100%; width: 100%;
} }
.main-container {
margin-left: 0px !important;
}
</style> </style>
...@@ -6,6 +6,7 @@ Vue.use(Router) ...@@ -6,6 +6,7 @@ Vue.use(Router)
/* Layout */ /* Layout */
import Layout from '@/layout' import Layout from '@/layout'
import EmptyLayout from '@/layout/EmptyLayout'
/** /**
* Note: 路由配置项 * Note: 路由配置项
...@@ -62,71 +63,76 @@ export const constantRoutes = [ ...@@ -62,71 +63,76 @@ export const constantRoutes = [
component: () => import('@/views/error/401'), component: () => import('@/views/error/401'),
hidden: true hidden: true
}, },
{ // {
path: '', // path: '',
component: Layout, // component: Layout,
redirect: 'index', // redirect: 'index',
// children: [
// {
// path: 'index',
// component: () => import('@/views/index'),
// name: 'Index',
// meta: { title: '首页', icon: 'dashboard', affix: true }
// }
// ]
// },
{
path: '/dw',
// component: Layout,
component: EmptyLayout,
redirect: 'noredirect',
children: [ children: [
{ {
path: 'index', path: 'index',
component: () => import('@/views/index'), component: () => import('@/views/index-dw'),
name: 'Index', name: 'Index',
meta: { title: '首页', icon: 'dashboard', affix: true } meta: { title: '首页2-dw', icon: 'dashboard', affix: true }
} }
] ]
}, },
{ {
path: '/dw', path: '/zz',
component: Layout, component: EmptyLayout,
hidden: true,
redirect: 'noredirect', redirect: 'noredirect',
children: [ children: [
{ {
path: 'index', path: 'index',
component: () => import('@/views/index-dw'), component: () => import('@/views/index-zz'),
name: 'Index', name: 'Index',
meta: { title: '首页2-dw', icon: 'dashboard', affix: true } meta: { title: '首页2-zz', icon: 'dashboard', affix: true }
}
]
},
{
path: '/guiji',
component: EmptyLayout,
hidden: true,
redirect: 'noredirect',
children: [
{
path: 'index',
component: () => import('@/views/index-guiji'),
name: 'Index',
meta: { title: '首页2-gj', icon: 'dashboard', affix: true }
}
]
},
{
path: '/wl',
component: EmptyLayout,
hidden: true,
redirect: 'noredirect',
children: [
{
path: 'index',
component: () => import('@/views/index-wl'),
name: 'Screen',
meta: { title: '首页-WL', icon: 'dashboard', affix: true }
} }
] ]
}, },
// {
// path: '/zz',
// component: Layout,
// redirect: 'noredirect',
// children: [
// {
// path: 'index',
// component: () => import('@/views/index-zz'),
// name: 'Index',
// meta: { title: '首页2-zz', icon: 'dashboard', affix: true }
// }
// ]
// },
// {
// path: '/guiji',
// component: Layout,
// redirect: 'noredirect',
// children: [
// {
// path: 'index',
// component: () => import('@/views/index-guiji'),
// name: 'Index',
// meta: { title: '首页2-gj', icon: 'dashboard', affix: true }
// }
// ]
// },
// {
// path: '/wl',
// component: Layout,
// redirect: 'noredirect',
// children: [
// {
// path: 'screen',
// component: () => import('@/views/index-wl'),
// name: 'Screen',
// meta: { title: '首页-WL', icon: 'dashboard', affix: true }
// }
// ]
// },
{ {
path: '/user', path: '/user',
component: Layout, component: Layout,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment