From 51912f8a02e35f172f6d30ed7a2f3a92c1407cf9 Mon Sep 17 00:00:00 2001 From: edison Date: Wed, 4 Sep 2024 20:54:04 +0800 Subject: [PATCH] fix(Transition): avoid applying transition hooks on comment vnode (#11788) close #11782 --- packages/runtime-core/src/components/BaseTransition.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/runtime-core/src/components/BaseTransition.ts b/packages/runtime-core/src/components/BaseTransition.ts index a31f28b2388..37534ad699f 100644 --- a/packages/runtime-core/src/components/BaseTransition.ts +++ b/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)