UNPKG

gepic

Version:

基于vue3的设计器,可视化开发页面表单

68 lines (67 loc) 2.17 kB
import { defineComponent as g, useAttrs as v, computed as i, createBlock as p, openBlock as n, unref as a, mergeProps as _, withCtx as c, renderSlot as r, createElementVNode as B, createElementBlock as E, createCommentVNode as u, Fragment as N, renderList as $, createVNode as b, createTextVNode as f, toDisplayString as x } from "vue"; import { ElDialog as D, ElButton as h } from "element-plus"; const P = { class: "epic-modal-footer" }, A = /* @__PURE__ */ g({ __name: "modal", props: { componentSchema: {}, hideConfirm: { type: Boolean } }, emits: ["ok", "close", "update:modelValue"], setup(k, { emit: C }) { const y = v(), o = k, t = C, l = i(() => { var e; return { ...o.componentSchema, ...y, title: ((e = o.componentSchema) == null ? void 0 : e.label) ?? "", class: "epic-modal-el epic-modal-main", "destroy-on-close": !0 }; }), s = i(() => { var e; return ((e = o.componentSchema) == null ? void 0 : e.children) ?? []; }); function S() { t("ok"); } function m() { t("update:modelValue", !1), t("close"); } return (e, d) => (n(), p(a(D), _(l.value, { title: l.value.label ?? "", class: "epic-modal-el epic-modal-main epic-scoped", "destroy-on-close": "", "onUpdate:modelValue": m }), { default: c(() => [ r(e.$slots, "default", {}, () => [ r(e.$slots, "edit-node", {}, () => [ s.value.length ? (n(!0), E(N, { key: 0 }, $(s.value, (V) => r(e.$slots, "node", { componentSchema: V })), 256)) : u("", !0) ]) ]), B("div", P, [ b(a(h), { onClick: m }, { default: c(() => d[0] || (d[0] = [ f(" 关闭 ") ])), _: 1 }), o.hideConfirm ? u("", !0) : (n(), p(a(h), { key: 0, type: "primary", onClick: S }, { default: c(() => [ f(x(l.value.okText ?? "确定"), 1) ]), _: 1 })) ]) ]), _: 3 }, 16, ["title"])); } }); export { A as default };