Skip to content

Commit 97bedf2

Browse files
committed
refactor(view): add keepAlive check
1 parent e6cb3d0 commit 97bedf2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/view.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ export default {
2626
let depth = 0
2727
let inactive = false
2828
while (parent && parent._routerRoot !== parent) {
29-
if (parent.$vnode && parent.$vnode.data.routerView) {
29+
const vnodeData = parent.$vnode ? parent.$vnode.data : {}
30+
if (vnodeData.routerView) {
3031
depth++
3132
}
32-
if (parent._directInactive && parent._inactive) {
33+
if (vnodeData.keepAlive && parent._directInactive && parent._inactive) {
3334
inactive = true
3435
}
3536
parent = parent.$parent

0 commit comments

Comments
 (0)