UNPKG

epic-designer

Version:

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

53 lines (52 loc) 1.96 kB
import { defineComponent as c, provide as f, createElementBlock as _, openBlock as V, withDirectives as v, createVNode as l, createElementVNode as x, vShow as E, unref as o, isRef as g, withCtx as h, createTextVNode as y, reactive as B } from "vue"; /* empty css */ /* empty css */ /* empty css */ /* empty css */ import "vue-draggable-plus"; import "../../../../../git/epic/epic-designer/node_modules/.pnpm/jsep@1.4.0/node_modules/jsep/dist/jsep.js"; import { useVModel as N } from "@vueuse/core"; import "../../../../../hooks/src/store/index.js"; import { pluginManager as T } from "../../../../../manager/src/pluginManager.js"; import k from "./optionItem.vue.js"; import { OPTIONS_EDITOR_TREE_KEY as w } from "./optionsEditorContext.js"; const C = { class: "ep-options-editor rounded" }, O = { class: "my-2 py-4 text-center text-gray-400" }, j = /* @__PURE__ */ c({ __name: "index", props: { modelValue: {}, tree: { type: Boolean } }, emits: ["update:modelValue"], setup(m, { emit: p }) { const n = m, a = p, d = T.component.get("button"), e = N(n, "modelValue", a); f(w, n.tree); function u() { const r = B({ label: "", value: "" }); e.value = [...e.value, r]; } return (r, t) => { var i; return V(), _("div", C, [ v(x("div", O, " 暂无选项 ", 512), [ [E, !((i = o(e)) != null && i.length)] ]), l(k, { modelValue: o(e), "onUpdate:modelValue": t[0] || (t[0] = (s) => g(e) ? e.value = s : null) }, null, 8, ["modelValue"]), l(o(d), { onClick: u }, { default: h(() => [...t[1] || (t[1] = [ y(" 添加选项 ", -1) ])]), _: 1 }) ]); }; } }); export { j as default };