]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(Transition): avoid applying transition hooks on comment vnode (#11788)
authoredison <daiwei521@126.com>
Wed, 4 Sep 2024 12:54:04 +0000 (20:54 +0800)
committerGitHub <noreply@github.com>
Wed, 4 Sep 2024 12:54:04 +0000 (20:54 +0800)
close #11782

packages/runtime-core/src/components/BaseTransition.ts

index a31f28b23887b48f1fe3f100ce1739dea0cc3bd1..37534ad699fc654c94571fb3aea8524522dd3e43 100644 (file)
@@ -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)