epic-designer
Version:
基于vue3的设计器,可视化开发页面表单
48 lines (47 loc) • 1.57 kB
JavaScript
import { defineComponent as c, provide as f, createElementBlock as V, openBlock as v, withDirectives as _, createVNode as i, createElementVNode as x, vShow as g, unref as o, isRef as h, withCtx as w, createTextVNode as y, reactive as B } from "vue";
/* empty css */
import "vuedraggable";
import { useVModel as C } from "@vueuse/core";
import "../../../../../hooks/src/store/index.js";
import { pluginManager as b } from "../../../../../utils/src/manager/pluginManager.js";
import k from "./optionItem.vue.js";
const N = { class: "" }, E = { class: "my-2 bg-white py-4 text-center text-gray-400" }, $ = /* @__PURE__ */ c({
__name: "index",
props: {
modelValue: {},
tree: { type: Boolean }
},
emits: ["update:modelValue"],
setup(a, { emit: m }) {
const n = a, u = m, d = b.getComponent("button"), e = C(n, "modelValue", u);
f("tree", n.tree);
function s() {
const l = B({
label: "",
value: ""
});
e.value = [...e.value, l];
}
return (l, t) => {
var r;
return v(), V("div", N, [
_(x("div", E, " 暂无选项 ", 512), [
[g, !((r = o(e)) != null && r.length)]
]),
i(k, {
modelValue: o(e),
"onUpdate:modelValue": t[0] || (t[0] = (p) => h(e) ? e.value = p : null)
}, null, 8, ["modelValue"]),
i(o(d), { onClick: s }, {
default: w(() => t[1] || (t[1] = [
y(" 添加选项 ")
])),
_: 1
})
]);
};
}
});
export {
$ as default
};