Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
node-sample
Project
Project
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
周韬
node-sample
Commits
b8ea9c36
Commit
b8ea9c36
authored
Apr 24, 2017
by
Evan You
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use more correct algo for activated components
parent
d87f6c60
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
entry-client.js
src/entry-client.js
+4
-1
No files found.
src/entry-client.js
View file @
b8ea9c36
...
@@ -40,7 +40,10 @@ router.onReady(() => {
...
@@ -40,7 +40,10 @@ router.onReady(() => {
router
.
beforeResolve
((
to
,
from
,
next
)
=>
{
router
.
beforeResolve
((
to
,
from
,
next
)
=>
{
const
matched
=
router
.
getMatchedComponents
(
to
)
const
matched
=
router
.
getMatchedComponents
(
to
)
const
prevMatched
=
router
.
getMatchedComponents
(
from
)
const
prevMatched
=
router
.
getMatchedComponents
(
from
)
const
activated
=
matched
.
filter
(
c
=>
prevMatched
.
indexOf
(
c
)
<
0
)
let
diffed
=
false
const
activated
=
matched
.
filter
((
c
,
i
)
=>
{
return
diffed
||
(
diffed
=
(
prevMatched
[
i
]
!==
c
))
})
if
(
!
activated
.
length
)
{
if
(
!
activated
.
length
)
{
return
next
()
return
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