Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohoblk-wap
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
陈峰
7 years ago
Commit
c770575d346f39851bbd1b7daca7b4703e6c4f33
1 parent
fc5d8f06
commit
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
src/common/router.js
src/common/router.js
View file @
c770575
...
...
@@ -2,14 +2,15 @@
export
function
createYoRouter
(
router
,
store
)
{
return
{
goBack
(
num
)
{
const
backNum
=
Math
.
abs
(
num
);
const
{
history
}
=
store
.
state
.
yoho
;
// const backNum = Math.abs(num);
// const {history} = store.state.yoho;
if
(
history
.
length
>
backNum
)
{
const
backRoute
=
history
[
history
.
length
-
(
backNum
+
1
)];
// if (history.length > backNum) {
// const backRoute = history[history.length - (backNum + 1)];
backRoute
&&
router
.
push
(
backRoute
.
fullPath
);
}
// backRoute && router.push(backRoute.fullPath);
// }
router
.
go
(
num
);
}
};
}
...
...
Please
register
or
login
to post a comment