mirror of
https://github.com/HeyPuter/puter
synced 2024-11-14 22:06:00 +00:00
dev: make el() yet more convenient
This commit is contained in:
parent
5965ab5de0
commit
25e9ed8227
@ -40,7 +40,12 @@ export default def(class UIElement extends AdvancedBase {
|
|||||||
|
|
||||||
const attrs = {};
|
const attrs = {};
|
||||||
for ( const a_or_c of a ) {
|
for ( const a_or_c of a ) {
|
||||||
if ( Array.isArray(a_or_c) ) {
|
if ( typeof a_or_c === 'string' ) {
|
||||||
|
el.innerText += a_or_c;
|
||||||
|
}
|
||||||
|
else if ( a_or_c instanceof HTMLElement ) {
|
||||||
|
el.appendChild(a_or_c);
|
||||||
|
} if ( Array.isArray(a_or_c) ) {
|
||||||
for ( const child of a_or_c ) {
|
for ( const child of a_or_c ) {
|
||||||
el.appendChild(child);
|
el.appendChild(child);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user