Commit b8ea9c36 authored by Evan You's avatar Evan You

use more correct algo for activated components

parent d87f6c60
......@@ -40,7 +40,10 @@ router.onReady(() => {
router.beforeResolve((to, from, next) => {
const matched = router.getMatchedComponents(to)
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) {
return next()
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment