Skip to content

Commit 1099c03

Browse files
authored
feat: handle reactive attributes
1 parent 423c617 commit 1099c03

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

addons/van_jsx/src/createElement.js

+9
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ const createElement = (jsxTag, { children, style, ref, ...props }) => {
1818
ele.addEventListener(key.replace("on", "").toLowerCase(), value);
1919
continue;
2020
}
21+
22+
// Handle reactive attributes
23+
if (typeof value === "object" && "val" in value) {
24+
van.derive(() => {
25+
setAttribute(ele, key, value.val);
26+
});
27+
continue;
28+
}
29+
2130
setAttribute(ele, key, value);
2231
continue;
2332
}

0 commit comments

Comments
 (0)