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

Commit ae3c14c

Browse files
committed
fix(runtime-vapor): don't overridden attrs in static template
closes #253
1 parent 5f92ff8 commit ae3c14c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/runtime-vapor/src/componentAttrs.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ export function fallThroughAttrs(instance: ComponentInternalInstance): void {
7272
if (inheritAttrs === false) return
7373

7474
if (block instanceof Element) {
75-
renderEffect(() => setDynamicProps(block, instance.attrs))
75+
// attrs in static template
76+
const initialAttrs: Record<string, string> = {}
77+
for (let i = 0; i < block.attributes.length; i++) {
78+
const attr = block.attributes[i]
79+
initialAttrs[attr.name] = attr.value
80+
}
81+
renderEffect(() => setDynamicProps(block, instance.attrs, initialAttrs))
7682
}
7783
}

0 commit comments

Comments
 (0)