Procházet zdrojové kódy

fix(hmr): always traverse static children in dev

fix #7921
close #8100
Evan You před 3 roky
rodič
revize
f17a82c769
1 změnil soubory, kde provedl 4 přidání a 2 odebrání
  1. 4 2
      packages/runtime-core/src/renderer.ts

+ 4 - 2
packages/runtime-core/src/renderer.ts

@@ -835,7 +835,8 @@ function baseCreateRenderer(
         areChildrenSVG,
         slotScopeIds
       )
-      if (__DEV__ && parentComponent && parentComponent.type.__hmrId) {
+      if (__DEV__) {
+        // necessary for HMR
         traverseStaticChildren(n1, n2)
       }
     } else if (!optimized) {
@@ -1110,7 +1111,8 @@ function baseCreateRenderer(
           isSVG,
           slotScopeIds
         )
-        if (__DEV__ && parentComponent && parentComponent.type.__hmrId) {
+        if (__DEV__) {
+          // necessary for HMR
           traverseStaticChildren(n1, n2)
         } else if (
           // #2080 if the stable fragment has a key, it's a <template v-for> that may