UNPKG

element-plus

Version:

A Component Library for Vue 3

37 lines (32 loc) 891 B
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var isServer = require('./isServer.js'); const globalNodes = []; let target = isServer["default"] ? void 0 : document.body; function createGlobalNode(id) { const el = document.createElement("div"); if (id !== void 0) { el.id = id; } target.appendChild(el); globalNodes.push(el); return el; } function removeGlobalNode(el) { globalNodes.splice(globalNodes.indexOf(el), 1); el.remove(); } function changeGlobalNodesTarget(el) { if (el !== target) { target = el; globalNodes.forEach((el2) => { if (el2.contains(target) === false) { target.appendChild(el2); } }); } } exports.changeGlobalNodesTarget = changeGlobalNodesTarget; exports.createGlobalNode = createGlobalNode; exports.removeGlobalNode = removeGlobalNode; //# sourceMappingURL=global-nodes.js.map