默认组件为div
This commit is contained in:
		@@ -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)
 | 
					    const element = document.createElement(tagName)
 | 
				
			||||||
    for (const key in attributes) {
 | 
					    for (const key in attributes) {
 | 
				
			||||||
        element.setAttribute(key, attributes[key])
 | 
					        element.setAttribute(key, attributes[key])
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user