fix: fixed bad use of get/hasAttribute
This commit is contained in:
@@ -69,18 +69,10 @@ export function h<
|
|||||||
const attribute = (attributes as any)[key];
|
const attribute = (attributes as any)[key];
|
||||||
if (attribute) {
|
if (attribute) {
|
||||||
if (attribute instanceof Ref) {
|
if (attribute instanceof Ref) {
|
||||||
if (element.hasAttribute(key)) {
|
(element as any)[key] = attribute.val;
|
||||||
element.setAttribute(key, attribute.val);
|
attribute.watch((newVal) => (element as any)[key] = newVal);
|
||||||
attribute.watch((newVal) => {
|
|
||||||
if (element.hasAttribute(key)) {
|
|
||||||
element.setAttribute(key, newVal);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (element.hasAttribute(key)) {
|
(element as any)[key] = attribute;
|
||||||
element.setAttribute(key, attribute);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user