Przeglądaj źródła

fix(runtime-vapor): attach scope id only to root sub-element

三咲智子 Kevin Deng 1 rok temu
rodzic
commit
4078206e16

+ 6 - 2
packages/runtime-vapor/src/apiCreateComponent.ts

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