1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2025-07-01 12:22:15 +02:00

Create DocumentFragment also with el()

This commit is contained in:
2023-11-06 14:04:27 +01:00
parent 324727cc0a
commit 0d70189908
14 changed files with 24 additions and 27 deletions

View File

@ -59,7 +59,7 @@ export function createElement(tag, attributes, ...connect){
break;
}
case tag==="#text": el= assign.call(this, document.createTextNode(""), attributes); break;
case tag==="<>": el= assign.call(this, document.createDocumentFragment(), attributes); break;
case tag==="<>" || !tag: el= assign.call(this, document.createDocumentFragment(), attributes); break;
case namespace!=="html": el= assign.call(this, document.createElementNS(namespace, tag), attributes); break;
case !el: el= assign.call(this, document.createElement(tag), attributes);
}