fa6a5ced by xiaodi

调整

1 parent 8d89e205
......@@ -6,11 +6,20 @@ export const constantRouterMap = [
{
path: '/',
name: 'index',
component: () => import('@/layouts/TabBarLayout'), // 路由懒加载
component: () => import('@/layouts/AppLayout'),
redirect: '/home',
meta: {
title: '首页', // 页面标题
keepAlive: false // keep-alive 标识
title: '首页',
keepAlive: false
},
children: [
{
path: '/',
component: () => import('@/layouts/TabBarLayout'),
redirect: '/home',
meta: {
title: '首页',
keepAlive: false
},
children: [
{
......@@ -23,10 +32,9 @@ export const constantRouterMap = [
path: '/about',
name: 'About',
component: () => import('@/views/home/about'),
meta: {
title: '关于我',
keepAlive: false
meta: { title: '关于我', keepAlive: false }
}
]
}
]
}
......
<template>
<div class="app-containter">
<keep-alive v-if="$route.meta.keepAlive">
<router-view></router-view>
</keep-alive>
<router-view v-else></router-view>
</div>
</template>
<script>
export default {
name: 'AppLayout'
}
</script>
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!