From d1df21f26450b8cdd0a96f7351956ada41608038 Mon Sep 17 00:00:00 2001 From: * <8> Date: Thu, 17 Feb 2022 11:42:16 +0800 Subject: [PATCH] Match-id-8100b99492d45f5c0d10ff72370a0fdc7ba249ad --- libs/horizon/src/dom/utils/DomCreator.ts | 19 ------------------- 1 file changed, 19 deletions(-) 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); }