UNPKG

ai-form-designer

Version:

vue3+adv的设计器,可视化开发页面表单

41 lines (40 loc) 1.3 kB
import { defineComponent as u, ref as p, inject as d, watch as f, toRaw as m, createElementBlock as g, openBlock as _, createVNode as h, unref as r } from "vue"; import { p as N, o as y, d as k } from "./index-DwcJO-0a.js"; const E = { class: "epic-sound-code" }, M = /* @__PURE__ */ u({ __name: "index", setup(O) { const c = N.getComponent("monacoEditor"), a = p(null), t = d("designer"), s = d("designerProps"); let n = {}; f(() => t.state.checkedNode, (e) => { var o; y(n, m(e)) || (o = a.value) == null || o.setValue(JSON.stringify(e, null, 2)); }, { deep: !0 }); const l = JSON.stringify(t.state.checkedNode, null, 2); function i(e) { try { if (!t.state.checkedNode) return !1; n = JSON.parse(e), k(t.state.checkedNode, n); } catch (o) { console.warn("[epic-desinger:源码]异常:", o); } } return (e, o) => (_(), g("div", E, [ h(r(c), { ref_key: "monacoEditorRef", ref: a, autoToggleTheme: "", class: "epic-editor", readOnly: r(s).sourceCodeReadOnly, "model-value": r(l), lineNumbers: "off", "onUpdate:modelValue": i }, null, 8, ["readOnly", "model-value"]) ])); } }); export { M as default };