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
fbfa70b4
Commit
fbfa70b4
authored
Apr 18, 2022
by
liuchenxi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: 取消缓存
parent
9e5d0f1a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
index.js
src/router/index.js
+10
-10
No files found.
src/router/index.js
View file @
fbfa70b4
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
);
...
...
@@ -202,13 +202,13 @@ const router = new Router({
base
:
'/member-tag/'
,
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
(
this
.
a
.
apps
,
componentName
);
}
next
();
})
//
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(this.a.apps, componentName);
//
}
//
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