diff --git a/packages/runtime-vapor/src/apiCreateComponent.ts b/packages/runtime-vapor/src/apiCreateComponent.ts index cb7580038..581a86079 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 ce0ad86ca..7f646546f 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, {