1
This commit is contained in:
32
admin/node_modules/element-plus/es/utils/vue/global-node.mjs
generated
vendored
Normal file
32
admin/node_modules/element-plus/es/utils/vue/global-node.mjs
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
import { isClient } from '@vueuse/core';
|
||||
|
||||
const globalNodes = [];
|
||||
let target = !isClient ? void 0 : document.body;
|
||||
function createGlobalNode(id) {
|
||||
const el = document.createElement("div");
|
||||
if (id !== void 0) {
|
||||
el.setAttribute("id", id);
|
||||
}
|
||||
if (target) {
|
||||
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)
|
||||
return;
|
||||
target = el;
|
||||
globalNodes.forEach((el2) => {
|
||||
if (target && !el2.contains(target)) {
|
||||
target.appendChild(el2);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export { changeGlobalNodesTarget, createGlobalNode, removeGlobalNode };
|
||||
//# sourceMappingURL=global-node.mjs.map
|
||||
Reference in New Issue
Block a user