From: 三咲智子 Kevin Deng Date: Fri, 15 Nov 2024 20:03:33 +0000 (+0800) Subject: fix(runtime-vapor): attach scope id only to root sub-element X-Git-Tag: v3.6.0-alpha.1~16^2~272 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4078206e16b4f7d12c967bbaad24326513ad2677;p=thirdparty%2Fvuejs%2Fcore.git fix(runtime-vapor): attach scope id only to root sub-element --- diff --git a/packages/runtime-vapor/src/apiCreateComponent.ts b/packages/runtime-vapor/src/apiCreateComponent.ts index 62681c9058..615b766f70 100644 --- a/packages/runtime-vapor/src/apiCreateComponent.ts +++ b/packages/runtime-vapor/src/apiCreateComponent.ts @@ -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)