Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ant-design-pro-vue
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tianzhuanghu
ant-design-pro-vue
Commits
5b88067d
Commit
5b88067d
authored
Feb 19, 2019
by
Sendya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: multi-tab mode always component keep-alive & cleanup eslint
Signed-off-by:
Sendya
<
18x@loacg.com
>
parent
9d00ebbd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
8 deletions
+9
-8
MultiTab.vue
src/components/MultiTab/MultiTab.vue
+2
-3
index.js
src/components/MultiTab/index.js
+1
-2
RouteView.vue
src/components/layouts/RouteView.vue
+6
-3
No files found.
src/components/MultiTab/MultiTab.vue
View file @
5b88067d
...
...
@@ -38,7 +38,7 @@ export default {
}
this
.
pages
=
this
.
pages
.
filter
(
page
=>
page
.
fullPath
!==
targetKey
)
this
.
fullPathList
=
this
.
fullPathList
.
filter
(
path
=>
path
!==
targetKey
)
}
,
}
},
watch
:
{
'$route'
:
function
(
newVal
)
{
...
...
@@ -53,4 +53,4 @@ export default {
}
}
}
</
script
>
\ No newline at end of file
</
script
>
src/components/MultiTab/index.js
View file @
5b88067d
import
MultiTab
from
'./MultiTab'
export
default
MultiTab
\ No newline at end of file
export
default
MultiTab
src/components/layouts/RouteView.vue
View file @
5b88067d
...
...
@@ -5,7 +5,7 @@ export default {
return
{}
},
render
()
{
const
{
$route
:
{
meta
}
}
=
this
const
{
$route
:
{
meta
}
,
$store
:
{
getters
}
}
=
this
const
inKeep
=
(
<
keep
-
alive
>
...
...
@@ -15,7 +15,10 @@ export default {
const
notKeep
=
(
<
router
-
view
/>
)
return
meta
.
keepAlive
?
inKeep
:
notKeep
// 这里增加了 multiTab 的判断,当开启了 multiTab 时
// 应当全部组件皆缓存,否则会导致切换页面后页面还原成原始状态
// 若确实不需要,可改为 return meta.keepAlive ? inKeep : notKeep
return
meta
.
keepAlive
||
getters
.
multiTab
?
inKeep
:
notKeep
}
}
</
script
>
</
script
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment