UNPKG

epic-designer

Version:

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

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