]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(runtime-vapor): attach scope id only to root sub-element
author三咲智子 Kevin Deng <sxzz@sxzz.moe>
Fri, 15 Nov 2024 20:03:33 +0000 (04:03 +0800)
committer三咲智子 Kevin Deng <sxzz@sxzz.moe>
Fri, 15 Nov 2024 20:03:33 +0000 (04:03 +0800)
packages/runtime-vapor/src/apiCreateComponent.ts

index 62681c9058ef29f17bba551f466fe70a9b1ef1bf..615b766f7011baca7cce74149d4aa6cf9fd170ea 100644 (file)
@@ -31,9 +31,13 @@ export function createComponent(
     once,
   )
 
-  instance.scopeIds = [...current.scopeIds]
+  if (singleRoot) {
+    instance.scopeIds.push(...current.scopeIds)
+  }
   const scopeId = current.type.__scopeId
-  if (scopeId) instance.scopeIds.push(scopeId)
+  if (scopeId) {
+    instance.scopeIds.push(scopeId)
+  }
 
   setupComponent(instance)