UNPKG

yanzhen-design-vue

Version:

27 lines (26 loc) 889 B
"use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); const vue = require("vue"); const openComponent = require("./openComponent.cjs"); const containerGroup = /* @__PURE__ */ new WeakMap(); function render(...args) { var _a; let [app, container, _namespace] = args; if (!container) container = document.createDocumentFragment(); const oldApp = containerGroup.get(container); if (oldApp) (_a = oldApp.destroy) == null ? void 0 : _a.call(oldApp); if (!app) return; const app1 = vue.createApp(app); const close = () => { app1.unmount(); }; app1.mount(container); const confirmAppInstance = { destroy: close }; containerGroup.set(container, confirmAppInstance); return confirmAppInstance; } exports.closeComponent = openComponent.closeComponent; exports.openComponent = openComponent.openComponent; exports.render = render;