]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
wip(vapor): fix setScopeId for vdom in vapor
authorEvan You <evan@vuejs.org>
Tue, 4 Feb 2025 13:55:32 +0000 (21:55 +0800)
committerEvan You <evan@vuejs.org>
Tue, 4 Feb 2025 13:55:32 +0000 (21:55 +0800)
packages/runtime-core/src/renderer.ts

index 99be57828f44027b99be86ac3c6a458034861dba..fff68dd2c6407f18d76a4ef18353c72e98c0b727 100644 (file)
@@ -759,8 +759,8 @@ function baseCreateRenderer(
         hostSetScopeId(el, slotScopeIds[i])
       }
     }
-    if (parentComponent) {
-      let subTree = parentComponent.subTree
+    let subTree = parentComponent && parentComponent.subTree
+    if (subTree) {
       if (
         __DEV__ &&
         subTree.patchFlag > 0 &&
@@ -774,13 +774,13 @@ function baseCreateRenderer(
         (isSuspense(subTree.type) &&
           (subTree.ssContent === vnode || subTree.ssFallback === vnode))
       ) {
-        const parentVNode = parentComponent.vnode
+        const parentVNode = parentComponent!.vnode
         setScopeId(
           el,
           parentVNode,
           parentVNode.scopeId,
           parentVNode.slotScopeIds,
-          parentComponent.parent,
+          parentComponent!.parent,
         )
       }
     }