Refactoring, styles, example

This commit is contained in:
2025-09-21 01:26:06 +02:00
parent bd7b7ac498
commit a941935336
3 changed files with 24 additions and 6 deletions

4
dom.js
View File

@@ -19,7 +19,7 @@ class DomHelper {
* @param {array|Element|string} children Children or single child/text to apply
* @returns Element
*/
createEl(tag, attr = {}, children = []) {
create(tag, attr = {}, children = []) {
//console.debug(`create: ${tag}`, attr, children);
let el = document.createElement(tag);
this.apply(el, attr);
@@ -101,7 +101,7 @@ const el = new Proxy(dom, {
get(target,name) {
return name in target
? target[name]
: (attr = {}, children = []) => target.createEl(name, attr, children);
: (attr = {}, children = []) => target.create(name, attr, children);
}
});