fa6a5ced by xiaodi

调整

1 parent 8d89e205
...@@ -6,11 +6,20 @@ export const constantRouterMap = [ ...@@ -6,11 +6,20 @@ 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 },
15 children: [
16 {
17 path: '/',
18 component: () => import('@/layouts/TabBarLayout'),
19 redirect: '/home',
20 meta: {
21 title: '首页',
22 keepAlive: false
14 }, 23 },
15 children: [ 24 children: [
16 { 25 {
...@@ -23,10 +32,9 @@ export const constantRouterMap = [ ...@@ -23,10 +32,9 @@ export const constantRouterMap = [
23 path: '/about', 32 path: '/about',
24 name: 'About', 33 name: 'About',
25 component: () => import('@/views/home/about'), 34 component: () => import('@/views/home/about'),
26 meta: { 35 meta: { title: '关于我', keepAlive: false }
27 title: '关于我',
28 keepAlive: false
29 } 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!