diff --git a/libs/horizon/src/dom/utils/DomCreator.ts b/libs/horizon/src/dom/utils/DomCreator.ts index 9d89ef5f..360aea81 100644 --- a/libs/horizon/src/dom/utils/DomCreator.ts +++ b/libs/horizon/src/dom/utils/DomCreator.ts @@ -5,13 +5,6 @@ export const NSS = { svg: 'http://www.w3.org/2000/svg', }; -const div = document.createElement('div'); -const span = document.createElement('span'); -const tr = document.createElement('tr'); -const td = document.createElement('td'); -const a = document.createElement('a'); -const p = document.createElement('p'); - // 创建DOM元素 export function createDom( tagName: string, @@ -23,18 +16,6 @@ export function createDom( if (ns !== NSS.html) { dom = document.createElementNS(ns, tagName); - } else if (tagName === 'div') { - dom = div.cloneNode(false); - } else if (tagName === 'span') { - dom = span.cloneNode(false); - } else if (tagName === 'tr') { - dom = tr.cloneNode(false); - } else if (tagName === 'td') { - dom = td.cloneNode(false); - } else if (tagName === 'a') { - dom = a.cloneNode(false); - } else if (tagName === 'p') { - dom = p.cloneNode(false); } else { dom = document.createElement(tagName); }