UNPKG

gepic

Version:

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

46 lines (45 loc) 1.47 kB
import { defineComponent as p, provide as c, createElementBlock as f, openBlock as V, withDirectives as v, createVNode as i, createElementVNode as _, vShow as x, unref as o, isRef as g, withCtx as h, createTextVNode as w, reactive as y } from "vue"; import B from "./optionItem.vue.js"; import { pluginManager as C } from "../../../utils/manager/pluginManager.js"; import { useVModel as b } from "@vueuse/core"; import "../../../hooks/store/index.js"; const k = { class: "" }, N = { class: "py-4 my-2 text-center text-gray-400 bg-white" }, T = /* @__PURE__ */ p({ __name: "index", props: { tree: { type: Boolean }, modelValue: {} }, emits: ["update:modelValue"], setup(a, { emit: m }) { const u = C.getComponent("button"), n = a, e = b(n, "modelValue", m); c("tree", n.tree); function d() { const l = y({ label: "", value: "" }); e.value = [...e.value, l]; } return (l, t) => { var r; return V(), f("div", k, [ v(_("div", N, " 暂无选项 ", 512), [ [x, !((r = o(e)) != null && r.length)] ]), i(B, { modelValue: o(e), "onUpdate:modelValue": t[0] || (t[0] = (s) => g(e) ? e.value = s : null) }, null, 8, ["modelValue"]), i(o(u), { onClick: d }, { default: h(() => t[1] || (t[1] = [ w(" 添加选项 ") ])), _: 1 }) ]); }; } }); export { T as default };