Skip to content

Commit b8ea9c3

Browse files
committed
use more correct algo for activated components
1 parent d87f6c6 commit b8ea9c3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/entry-client.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ router.onReady(() => {
4040
router.beforeResolve((to, from, next) => {
4141
const matched = router.getMatchedComponents(to)
4242
const prevMatched = router.getMatchedComponents(from)
43-
const activated = matched.filter(c => prevMatched.indexOf(c) < 0)
43+
let diffed = false
44+
const activated = matched.filter((c, i) => {
45+
return diffed || (diffed = (prevMatched[i] !== c))
46+
})
4447
if (!activated.length) {
4548
return next()
4649
}

0 commit comments

Comments
 (0)