移除空的class
This commit is contained in:
parent
6b6dd495ce
commit
a86f0c77d8
@ -3,7 +3,7 @@ export function createElement({ innerText, textContent, onclick, children = [],
|
||||
for (const key in attributes) {
|
||||
element.setAttribute(key, attributes[key])
|
||||
}
|
||||
element.classList.add(...classList)
|
||||
if (classList.length) element.classList.add(...classList)
|
||||
if (innerText) element.innerText = innerText
|
||||
if (textContent) element.textContent = textContent
|
||||
if (onclick) element.onclick = onclick
|
||||
|
Loading…
Reference in New Issue
Block a user