默认组件为div

This commit is contained in:
2023-10-02 22:29:49 +08:00
parent ff2f6c7e3c
commit cdb2261773
1 changed files with 1 additions and 1 deletions

View File

@ -1,4 +1,4 @@
export function createElement({ innerText, textContent, onclick, children = [], dataset, classList = [], ...attributes }, tagName) {
export function createElement({ innerText, textContent, onclick, children = [], dataset, classList = [], ...attributes }, tagName = 'div') {
const element = document.createElement(tagName)
for (const key in attributes) {
element.setAttribute(key, attributes[key])