Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
xqz
/
dianDemo
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
fa6a5ced
authored
2020-05-31 22:50:14 +0800
by
xiaodi
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
调整
1 parent
8d89e205
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
6 deletions
src/config/router.config.js
src/layouts/AppLayout.vue
src/config/router.config.js
View file @
fa6a5ce
...
...
@@ -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
}
}
]
}
]
}
...
...
src/layouts/AppLayout.vue
0 → 100644
View file @
fa6a5ce
<
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
>
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment