瀏覽代碼

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)