소스 검색

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

close #11782
edison 1 년 전
부모
커밋
51912f8a02
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  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)