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
3c9af8a3
Commit
3c9af8a3
authored
Apr 18, 2022
by
liuchenxi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/3月会员标签'
parents
f7f370bd
1bbad60b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
index.js
src/router/index.js
+3
-7
No files found.
src/router/index.js
View file @
3c9af8a3
import
Router
from
'vue-router'
;
import
_import
from
'./_import.js'
;
import
delCache
from
'@/utils/router-utils.js'
;
//
import delCache from '@/utils/router-utils.js';
const
errorPage
=
r
=>
{
import
(
'view/errorPage/index.vue'
).
then
(
module
=>
{
r
(
module
);
...
...
@@ -203,12 +203,8 @@ const router = new Router({
scrollBehavior
:
()
=>
({
y
:
0
})
})
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
const
{
keepAlive
,
componentName
,
fromPath
=
[]
}
=
to
.
meta
||
{};
fromPath
.
push
(
'/'
);
// 当前路径的keepAlive为true而且from.path不在fromPath中时,将清除to.path的缓存
if
(
keepAlive
&&
fromPath
.
every
(
el
=>
el
!=
from
.
path
))
{
delCache
(
router
.
apps
,
componentName
);
}
const
{
fromPath
=
[]
}
=
from
.
meta
||
{};
from
.
meta
.
keepAlive
=
fromPath
.
includes
(
to
.
path
);
next
();
})
export
default
router
;
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