Explorar o código

fix(Transition): avoid applying transition hooks on comment vnode (#11788)

close #11782
edison hai 1 ano
pai
achega
51912f8a02
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      packages/runtime-core/src/components/BaseTransition.ts

+ 4 - 1
packages/runtime-core/src/components/BaseTransition.ts

@@ -193,7 +193,10 @@ const BaseTransitionImpl: ComponentOptions = {
         // #11061, ensure enterHooks is fresh after clone
         hooks => (enterHooks = hooks),
       )
-      setTransitionHooks(innerChild, enterHooks)
+
+      if (innerChild.type !== Comment) {
+        setTransitionHooks(innerChild, enterHooks)
+      }
 
       const oldChild = instance.subTree
       const oldInnerChild = oldChild && getInnerChild(oldChild)