Show debug info

This commit is contained in:
redphx
2024-07-18 20:47:58 +07:00
parent 1f3e4b8250
commit 5b4088cc81
4 changed files with 77 additions and 2 deletions

View File

@@ -35,7 +35,13 @@ function createElement<T=HTMLElement>(elmName: string, props: {[index: string]:
if (hasNs) {
$elm.setAttributeNS(null, key, props[key]);
} else {
$elm.setAttribute(key, props[key]);
if (key === 'on') {
for (const eventName in props[key]) {
$elm.addEventListener(eventName, props[key][eventName]);
}
} else {
$elm.setAttribute(key, props[key]);
}
}
}