Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
memberTag-web
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
memberTag
memberTag-web
Commits
1f8638e6
Commit
1f8638e6
authored
Jul 29, 2022
by
caoyanzhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: keep alive优化
parent
5dd255d6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
index.js
src/router/index.js
+2
-2
No files found.
src/router/index.js
View file @
1f8638e6
...
...
@@ -205,11 +205,11 @@ const router = new Router({
})
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
const
{
keepAlive
,
componentName
,
fromPath
}
=
to
.
meta
||
{};
if
(
keepAlive
&&
fromPath
.
every
(
el
=>
el
!=
'/'
))
{
if
(
keepAlive
&&
Array
.
isArray
(
fromPath
)
&&
fromPath
.
every
(
el
=>
el
!=
'/'
))
{
fromPath
.
push
(
'/'
);
}
// 当前路径的keepAlive为true而且from.path不在fromPath中时,将清除to.path的缓存
if
(
keepAlive
&&
fromPath
.
every
(
el
=>
el
!=
from
.
path
))
{
if
(
keepAlive
&&
Array
.
isArray
(
fromPath
)
&&
fromPath
.
every
(
el
=>
el
!=
from
.
path
))
{
delCache
(
router
.
apps
,
componentName
);
}
next
();
...
...
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