fa6a5ced by xiaodi

调整

1 parent 8d89e205
...@@ -6,27 +6,35 @@ export const constantRouterMap = [ ...@@ -6,27 +6,35 @@ export const constantRouterMap = [
6 { 6 {
7 path: '/', 7 path: '/',
8 name: 'index', 8 name: 'index',
9 component: () => import('@/layouts/TabBarLayout'), // 路由懒加载 9 component: () => import('@/layouts/AppLayout'),
10 redirect: '/home', 10 redirect: '/home',
11 meta: { 11 meta: {
12 title: '首页', // 页面标题 12 title: '首页',
13 keepAlive: false // keep-alive 标识 13 keepAlive: false
14 }, 14 },
15 children: [ 15 children: [
16 { 16 {
17 path: '/home', 17 path: '/',
18 name: 'Home', 18 component: () => import('@/layouts/TabBarLayout'),
19 component: () => import('@/views/home/index'), 19 redirect: '/home',
20 meta: { title: '首页', keepAlive: false }
21 },
22 {
23 path: '/about',
24 name: 'About',
25 component: () => import('@/views/home/about'),
26 meta: { 20 meta: {
27 title: '关于我', 21 title: '首页',
28 keepAlive: false 22 keepAlive: false
29 } 23 },
24 children: [
25 {
26 path: '/home',
27 name: 'Home',
28 component: () => import('@/views/home/index'),
29 meta: { title: '首页', keepAlive: false }
30 },
31 {
32 path: '/about',
33 name: 'About',
34 component: () => import('@/views/home/about'),
35 meta: { title: '关于我', keepAlive: false }
36 }
37 ]
30 } 38 }
31 ] 39 ]
32 } 40 }
......
1 <template>
2 <div class="app-containter">
3 <keep-alive v-if="$route.meta.keepAlive">
4 <router-view></router-view>
5 </keep-alive>
6 <router-view v-else></router-view>
7 </div>
8 </template>
9
10 <script>
11 export default {
12 name: 'AppLayout'
13 }
14 </script>
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!