Files
SingBox-Gopanel/frontend/admin/node_modules/element-plus/lib/utils/vue/global-node.js
CN-JS-HuiBai db7f1ba82f
Some checks failed
build / build (api, amd64, linux) (push) Failing after -51s
build / build (api, arm64, linux) (push) Failing after -52s
build / build (api.exe, amd64, windows) (push) Failing after -51s
使用VUE重构项目
2026-04-20 00:19:11 +08:00

33 lines
1010 B
JavaScript

Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_runtime = require('../../_virtual/_rolldown/runtime.js');
let _vueuse_core = require("@vueuse/core");
//#region ../../packages/utils/vue/global-node.ts
const globalNodes = [];
let target = !_vueuse_core.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((el) => {
if (target && !el.contains(target)) target.appendChild(el);
});
}
//#endregion
exports.changeGlobalNodesTarget = changeGlobalNodesTarget;
exports.createGlobalNode = createGlobalNode;
exports.removeGlobalNode = removeGlobalNode;
//# sourceMappingURL=global-node.js.map