]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(runtime-core): fix keep-alive tree-shaking
authorEvan You <yyx990803@gmail.com>
Fri, 7 Feb 2020 22:00:39 +0000 (17:00 -0500)
committerEvan You <yyx990803@gmail.com>
Fri, 7 Feb 2020 22:00:39 +0000 (17:00 -0500)
packages/runtime-core/src/components/KeepAlive.ts

index 3d76113b0ffe521cadf998f5122145765b5a548d..18105efa5ab186ea6ac4f60d74fa9046593fefff 100644 (file)
@@ -283,7 +283,7 @@ function registerKeepAliveHook(
   if (target) {
     let current = target.parent
     while (current && current.parent) {
-      if (current.parent.type === KeepAliveImpl) {
+      if (isKeepAlive(current.parent.vnode)) {
         injectToKeepAliveRoot(wrappedHook, type, target, current)
       }
       current = current.parent