Parcourir la source

fix(runtime-core): fix dev fragment root flag check

Evan You il y a 5 ans
Parent
commit
9cf75258c8
1 fichiers modifiés avec 5 ajouts et 1 suppressions
  1. 5 1
      packages/runtime-core/src/renderer.ts

+ 5 - 1
packages/runtime-core/src/renderer.ts

@@ -848,7 +848,11 @@ function baseCreateRenderer(
     }
     if (parentComponent) {
       let subTree = parentComponent.subTree
-      if (__DEV__ && subTree.patchFlag & PatchFlags.DEV_ROOT_FRAGMENT) {
+      if (
+        __DEV__ &&
+        subTree.patchFlag > 0 &&
+        subTree.patchFlag & PatchFlags.DEV_ROOT_FRAGMENT
+      ) {
         subTree =
           filterSingleRoot(subTree.children as VNodeArrayChildren) || subTree
       }