Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

Commit 7a98f4b

Browse files
committed
fix(runtime-vapor): invoke getter for static attrs
1 parent af75b64 commit 7a98f4b

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

packages/runtime-vapor/src/apiCreateComponent.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
walkRawProps,
1313
} from './componentProps'
1414
import { type RawSlots, isDynamicSlotFn } from './componentSlots'
15-
import { setInheritAttrs, withAttrs } from './componentAttrs'
15+
import { withAttrs } from './componentAttrs'
1616
import { isString } from '@vue/shared'
1717
import { renderEffect } from './renderEffect'
1818
import { normalizeBlock } from './dom/element'
@@ -90,7 +90,7 @@ function fallbackComponent(
9090
}
9191

9292
if (singleRoot) {
93-
setInheritAttrs(true)
93+
instance.dynamicAttrs = true
9494
}
9595

9696
return el

packages/runtime-vapor/src/componentAttrs.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,13 @@ export function patchAttrs(
6060

6161
if (key === 'class' || key === 'style') {
6262
;(key === 'class' ? classes : styles).push(
63-
hasDynamicProps ? (getter ? value : () => value) : value,
63+
hasDynamicProps
64+
? getter
65+
? value
66+
: () => value
67+
: getter
68+
? value()
69+
: value,
6470
)
6571
} else if (getter) {
6672
Object.defineProperty(attrs, key, {

0 commit comments

Comments
 (0)