]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(runtime-vapor): add scope id for fallback component
author三咲智子 Kevin Deng <sxzz@sxzz.moe>
Thu, 14 Nov 2024 20:10:59 +0000 (04:10 +0800)
committer三咲智子 Kevin Deng <sxzz@sxzz.moe>
Thu, 14 Nov 2024 20:10:59 +0000 (04:10 +0800)
packages/runtime-vapor/src/apiCreateComponent.ts

index df67f173600fcd8fc7a5aadd67e9aad744a7132e..0d81b41ac9bd1ceda9f50e04f2915bcfe79ab259 100644 (file)
@@ -96,7 +96,14 @@ function fallbackComponent(
 
   if (singleRoot) {
     instance.dynamicAttrs = true
+    for (let i = 0; i < instance.scopeIds.length; i++) {
+      const id = instance.scopeIds[i]
+      el.setAttribute(id, '')
+    }
   }
 
+  const scopeId = instance.type.__scopeId
+  if (scopeId) el.setAttribute(scopeId, '')
+
   return el
 }