From: 三咲智子 Kevin Deng Date: Thu, 14 Nov 2024 15:59:37 +0000 (+0800) Subject: fix(runtime-vapor): invoke getter for static attrs X-Git-Tag: v3.6.0-alpha.1~16^2~283 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a98f4b565df81e20ed4b779548ece94c8522da0;p=thirdparty%2Fvuejs%2Fcore.git fix(runtime-vapor): invoke getter for static attrs --- diff --git a/packages/runtime-vapor/src/apiCreateComponent.ts b/packages/runtime-vapor/src/apiCreateComponent.ts index cb75800381..581a86079a 100644 --- a/packages/runtime-vapor/src/apiCreateComponent.ts +++ b/packages/runtime-vapor/src/apiCreateComponent.ts @@ -12,7 +12,7 @@ import { walkRawProps, } from './componentProps' import { type RawSlots, isDynamicSlotFn } from './componentSlots' -import { setInheritAttrs, withAttrs } from './componentAttrs' +import { withAttrs } from './componentAttrs' import { isString } from '@vue/shared' import { renderEffect } from './renderEffect' import { normalizeBlock } from './dom/element' @@ -90,7 +90,7 @@ function fallbackComponent( } if (singleRoot) { - setInheritAttrs(true) + instance.dynamicAttrs = true } return el diff --git a/packages/runtime-vapor/src/componentAttrs.ts b/packages/runtime-vapor/src/componentAttrs.ts index ce0ad86ca4..7f646546fe 100644 --- a/packages/runtime-vapor/src/componentAttrs.ts +++ b/packages/runtime-vapor/src/componentAttrs.ts @@ -60,7 +60,13 @@ export function patchAttrs( if (key === 'class' || key === 'style') { ;(key === 'class' ? classes : styles).push( - hasDynamicProps ? (getter ? value : () => value) : value, + hasDynamicProps + ? getter + ? value + : () => value + : getter + ? value() + : value, ) } else if (getter) { Object.defineProperty(attrs, key, {