ai-form-designer
Version:
vue3+adv的设计器,可视化开发页面表单
71 lines (70 loc) • 1.96 kB
JavaScript
import { defineComponent as V, computed as k, createElementBlock as a, openBlock as l, createElementVNode as p, Fragment as g, renderList as C, createVNode as c, createCommentVNode as y, unref as r } from "vue";
import { p as U, k as P } from "./index-DwcJO-0a.js";
import { _ as b } from "./icon.vue_vue_type_script_setup_true_lang-DW206h_7.js";
const E = {
key: 0,
class: "epic-del-btn"
}, N = ["onClick"], D = /* @__PURE__ */ V({
__name: "index",
props: {
modelValue: {
type: Array,
default: () => []
}
},
emits: ["update:modelValue"],
setup(u, { emit: d }) {
const m = U.getComponent("number"), i = u, v = d, o = k({
get() {
return i.modelValue;
},
set(e) {
v("update:modelValue", e);
}
});
function _() {
const e = {
type: "col",
children: [],
componentProps: {
span: 12
},
id: P()
};
o.value.push(e);
}
function f(e) {
o.value = o.value.filter((h, n) => e !== n);
}
return (e, h) => (l(), a("div", null, [
(l(!0), a(g, null, C(o.value, (n, s) => (l(), a("div", {
key: s,
class: "EColEditor-item"
}, [
c(r(m), {
value: n.componentProps.span,
"onUpdate:value": (t) => n.componentProps.span = t,
modelValue: n.componentProps.span,
"onUpdate:modelValue": (t) => n.componentProps.span = t,
style: { width: "100%" },
min: 1,
max: 24
}, null, 8, ["value", "onUpdate:value", "modelValue", "onUpdate:modelValue"]),
o.value.length > 1 ? (l(), a("div", E, [
p("span", {
onClick: (t) => f(s)
}, [
c(r(b), { name: "icon-shanchu1" })
], 8, N)
])) : y("", !0)
]))), 128)),
p("div", {
class: "add-btn",
onClick: _
}, " 添加 ")
]));
}
});
export {
D as default
};