UNPKG

sohelp-ele

Version:

SohelpEle Library

155 lines (154 loc) 4.65 kB
(function() { "use strict"; try { if (typeof document != "undefined") { var elementStyle = document.createElement("style"); elementStyle.appendChild(document.createTextNode("")); document.head.appendChild(elementStyle); } } catch (e) { console.error("vite-plugin-css-injected-by-js", e); } })(); "use strict"; var SohelpVformModal = require("../sohelp-vform-modal"); function _interopDefaultLegacy(e) { return e && typeof e === "object" && "default" in e ? e : { "default": e }; } var SohelpVformModal__default = /* @__PURE__ */ _interopDefaultLegacy(SohelpVformModal); var render = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; return _c("div", _vm._l(_vm.pool, function(item, index2) { return _c("sohelp-vform-modal", { key: index2, ref: item.refid, refInFor: true, attrs: { "refid": item.refid, "visible": item.visible, "title": item.title }, on: { "update:visible": function($event) { return _vm.$set(item, "visible", $event); } } }); }), 1); }; var staticRenderFns = []; var index_vue_vue_type_style_index_0_scoped_true_lang = ""; function normalizeComponent(scriptExports, render2, staticRenderFns2, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) { var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports; if (render2) { options.render = render2; options.staticRenderFns = staticRenderFns2; options._compiled = true; } if (functionalTemplate) { options.functional = true; } if (scopeId) { options._scopeId = "data-v-" + scopeId; } var hook; if (moduleIdentifier) { hook = function(context) { context = context || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; if (!context && typeof __VUE_SSR_CONTEXT__ !== "undefined") { context = __VUE_SSR_CONTEXT__; } if (injectStyles) { injectStyles.call(this, context); } if (context && context._registeredComponents) { context._registeredComponents.add(moduleIdentifier); } }; options._ssrRegister = hook; } else if (injectStyles) { hook = shadowMode ? function() { injectStyles.call( this, (options.functional ? this.parent : this).$root.$options.shadowRoot ); } : injectStyles; } if (hook) { if (options.functional) { options._injectStyles = hook; var originalRender = options.render; options.render = function renderWithStyleInjection(h, context) { hook.call(context); return originalRender(h, context); }; } else { var existing = options.beforeCreate; options.beforeCreate = existing ? [].concat(existing, hook) : [hook]; } } return { exports: scriptExports, options }; } const __vue2_script = { name: "SohelpVformModalPool", components: { SohelpVformModal: SohelpVformModal__default["default"] }, created() { }, data() { return { pool: [] }; }, methods: { async open(refid, config) { var _a; let data = (_a = this.pool) == null ? void 0 : _a.filter((item) => { return item.refid === refid; }); let exist = data.length == 0 ? false : true; if (!exist) { this.pool.push(Object.assign({}, { refid, visible: false }, config || {})); } let promise = new Promise((resolve, reject) => { this.$nextTick(async () => { const instance = this.$refs[refid][0]; instance.show(config); await instance.isDone(); instance.reset(); resolve(instance); }); }); return promise; }, show(refid, config) { let instance = this.$refs[refid][0]; instance == null ? void 0 : instance.show(config); }, hide(refid) { let instance = this.$refs[refid][0]; instance == null ? void 0 : instance.hide(); }, close(refid) { let instance = this.$refs[refid][0]; instance == null ? void 0 : instance.close(); delete this.pool[refid]; }, get(refid) { let instance = this.$refs[refid][0]; return instance; } } }; const __cssModules = {}; var __component__ = /* @__PURE__ */ normalizeComponent( __vue2_script, render, staticRenderFns, false, __vue2_injectStyles, "03988264", null, null ); function __vue2_injectStyles(context) { for (let o in __cssModules) { this[o] = __cssModules[o]; } } var index = /* @__PURE__ */ function() { return __component__.exports; }(); module.exports = index;