UNPKG

form-designer-xinyi

Version:

基于vue3的设计器,可视化开发页面表单

40 lines (39 loc) 1.22 kB
import { defineComponent as l, ref as i, inject as u, watch as f, toRaw as p, openBlock as m, createElementBlock as _, createVNode as g, unref as a } from "vue"; import { p as h, c as N, d as k } from "./revoke-iScTU0eW.js"; const E = { class: "epic-sound-code" }, S = /* @__PURE__ */ l({ __name: "index", setup(y) { const r = h.getComponent("monacoEditor"), c = i(null), t = u("designer"); let n = {}; f(() => t.state.checkedNode, (e) => { var o; N(n, p(e)) || (o = c.value) == null || o.setValue(JSON.stringify(e, null, 2)); }, { deep: !0 }); const d = JSON.stringify(t.state.checkedNode, null, 2); function s(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) => (m(), _("div", E, [ g(a(r), { ref_key: "monacoEditorRef", ref: c, autoToggleTheme: "", class: "epic-editor", "model-value": a(d), lineNumbers: "off", "onUpdate:modelValue": s }, null, 8, ["model-value"]) ])); } }); export { S as default };