Skip to content

Commit

Permalink
fix(router-view): add condition to see whether the tree is inactive
Browse files Browse the repository at this point in the history
  • Loading branch information
zrh122 committed Jan 22, 2019
1 parent 2191ee1 commit 0bcc34e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/components/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ export default {
let depth = 0
let inactive = false
while (parent && parent._routerRoot !== parent) {
if (parent.$vnode && parent.$vnode.data.routerView) {
depth++
}
if (parent._inactive) {
inactive = true
const vnodeData = parent.$vnode && parent.$vnode.data
if (vnodeData) {
if (vnodeData.routerView) {
depth++
}
if (vnodeData.keepAlive && parent._inactive) {
inactive = true
}
}
parent = parent.$parent
}
Expand Down

0 comments on commit 0bcc34e

Please sign in to comment.