1.2.26 add style option to h()
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 3s

This commit is contained in:
2026-04-29 16:54:54 +02:00
parent 771f4a9f83
commit 0df4b3912d
7 changed files with 24 additions and 7 deletions

View File

@@ -43,6 +43,7 @@
when: () => when,
watch: () => watch,
router: () => router,
onUnmount: () => onUnmount,
mount: () => mount,
h: () => h,
each: () => each,
@@ -367,6 +368,8 @@
el.className = val || "";
else if (val == null)
el.removeAttribute(k);
else if (k === "style" && typeof val === "string")
el.setAttribute("style", val);
else if (k in el && !isSVG)
el[k] = val;
else
@@ -382,7 +385,9 @@
} else {
const val = validateAttr(k, v);
if (val != null) {
if (k in el && !isSVG)
if (k === "style" && typeof val === "string")
el.setAttribute("style", val);
else if (k in el && !isSVG)
el[k] = val;
else
el.setAttribute(k, val === true ? "" : val);