@coderlt/form-designer
Version:
基于vue3的设计器,可视化开发页面表单
36 lines (35 loc) • 1.18 kB
JavaScript
import { defineComponent as i, ref as l, inject as _, watch as p, toRaw as u, openBlock as f, createElementBlock as m, createVNode as h, unref as d } from "vue";
import { p as g, o as N, h as k } from "./index-74b7090f.js";
import { _ as v } from "./_plugin-vue_export-helper-dad06003.js";
const x = { class: "epic-sound-code" }, y = /* @__PURE__ */ i({
__name: "index",
setup(E) {
const c = g.getComponent("monacoEditor"), a = l(null), o = _("designer");
let t = {};
p(() => o.state.checkedNode, (e) => {
var n;
N(t, u(e)) || (n = a.value) == null || n.setValue(JSON.stringify(e, null, 2));
}, {
deep: !0
});
const s = JSON.stringify(o.state.checkedNode, null, 2);
function r(e) {
if (!o.state.checkedNode)
return !1;
t = JSON.parse(e), k(o.state.checkedNode, t);
}
return (e, n) => (f(), m("div", x, [
h(d(c), {
ref_key: "monacoEditorRef",
ref: a,
class: "editor",
"model-value": d(s),
"onUpdate:modelValue": r
}, null, 8, ["model-value"])
]));
}
});
const C = /* @__PURE__ */ v(y, [["__scopeId", "data-v-aa433531"]]);
export {
C as default
};