Skip to content

Commit

Permalink
refactor(view): add keepAlive check
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Jan 14, 2020
1 parent e6cb3d0 commit 97bedf2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ export default {
let depth = 0
let inactive = false
while (parent && parent._routerRoot !== parent) {
if (parent.$vnode && parent.$vnode.data.routerView) {
const vnodeData = parent.$vnode ? parent.$vnode.data : {}
if (vnodeData.routerView) {
depth++
}
if (parent._directInactive && parent._inactive) {
if (vnodeData.keepAlive && parent._directInactive && parent._inactive) {
inactive = true
}
parent = parent.$parent
Expand Down

0 comments on commit 97bedf2

Please sign in to comment.