UNPKG

snowy-designer

Version:

基于Epic-Designer-Pro版本的设计器,可视化开发页面表单

75 lines (74 loc) 2.14 kB
import { defineComponent as s, ref as d, watch as c, createElementBlock as v, openBlock as f, withDirectives as h, createVNode as a, createElementVNode as V, toDisplayString as _, vShow as w, unref as m, withCtx as g, createTextVNode as x, reactive as y } from "vue"; /* empty css */ import "radix-vue"; import "clsx"; import "tailwind-merge"; import "lucide-vue-next"; import "../../../../base-ui/src/shadch-ui/button/index.js"; import { useVModel as C } from "@vueuse/core"; import "../../../../base-ui/src/shadch-ui/toast/index.js"; import "../../../../../hooks/src/store/index.js"; import "lodash"; import "../../../../../utils/src/manager/pluginManager.js"; import "monaco-editor"; import "../../../../../utils/src/request/index.js"; import "vuedraggable"; import k from "./optionItem.vue.js"; import N from "../../../../base-ui/src/shadch-ui/button/Button.vue.js"; const b = { class: "" }, L = /* @__PURE__ */ s({ __name: "options", props: { modelValue: {}, placeholder: { default: "暂无数据" } }, emits: ["update:modelValue"], setup(p, { emit: n }) { const t = C(p, "modelValue", n), o = d([]); c( () => t.value, () => { o.value = t.value ?? []; }, { deep: !0, // 深度监听 immediate: !0 // 立即执行 } ); function l(e) { t.value = e; } function u() { const e = y({ label: "", value: "" }); o.value.push(e), l(o.value); } return (e, r) => { var i; return f(), v("div", b, [ h(V("div", { class: "my-2 bg-white py-4 text-center text-gray-400" }, _(e.placeholder), 513), [ [w, !((i = m(t)) != null && i.length) && e.placeholder] ]), a(k, { "model-value": o.value, "onUpdate:modelValue": l }, null, 8, ["model-value"]), a(m(N), { size: "xs", onClick: u }, { default: g(() => r[0] || (r[0] = [ x(" 新增选项 ") ])), _: 1 }) ]); }; } }); export { L as default };