epic-designer-gold
Version:
基于vue3的设计器,可视化开发页面表单
41 lines (40 loc) • 1.33 kB
JavaScript
import { defineComponent as d, ref as f, onMounted as v, openBlock as V, createElementBlock as S, createVNode as _, unref as l, isRef as E } from "vue";
import { p as u, E as n } from "./pluginManager-BNLy8dPz.js";
import { u as D } from "./index-NT_HkNlB.js";
import { u as b } from "./index-B1s67XDZ.js";
const g = { class: "" }, k = /* @__PURE__ */ d({
__name: "index",
props: {
modelValue: {}
},
emits: ["update:modelValue", "update:EOptionsEditor"],
setup(r, { emit: s }) {
const p = u.getComponent("select"), { t: c } = b(), m = r, t = f([]), o = D(m, "modelValue", s);
return n.on("deleteSourceData", (e) => {
o.value === e && (o.value = "");
}), n.on("updateSource", (e) => {
t.value = u.sourceData.map((a) => ({
...a,
label: a.apiName,
value: a.id
}));
}), v(() => {
t.value = u.sourceData.map((e) => ({
...e,
label: e.apiName,
value: e.id
}));
}), (e, a) => (V(), S("div", g, [
_(l(p), {
modelValue: l(o),
"onUpdate:modelValue": a[0] || (a[0] = (i) => E(o) ? o.value = i : null),
placeholder: l(c)("pleaseSelectDataSource"),
clearable: "",
options: t.value
}, null, 8, ["modelValue", "placeholder", "options"])
]));
}
});
export {
k as default
};