diff --git a/src/config/router.config.js b/src/config/router.config.js index 1d926b7..965aab9 100644 --- a/src/config/router.config.js +++ b/src/config/router.config.js @@ -6,27 +6,35 @@ 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: '/home', - name: 'Home', - component: () => import('@/views/home/index'), - meta: { title: '首页', keepAlive: false } - }, - { - path: '/about', - name: 'About', - component: () => import('@/views/home/about'), + path: '/', + component: () => import('@/layouts/TabBarLayout'), + redirect: '/home', meta: { - title: '关于我', + title: '首页', keepAlive: false - } + }, + children: [ + { + path: '/home', + name: 'Home', + component: () => import('@/views/home/index'), + meta: { title: '首页', keepAlive: false } + }, + { + path: '/about', + name: 'About', + component: () => import('@/views/home/about'), + meta: { title: '关于我', keepAlive: false } + } + ] } ] } diff --git a/src/layouts/AppLayout.vue b/src/layouts/AppLayout.vue new file mode 100644 index 0000000..faaa5b3 --- /dev/null +++ b/src/layouts/AppLayout.vue @@ -0,0 +1,14 @@ + + +