gepic
Version:
基于vue3的设计器,可视化开发页面表单
44 lines (43 loc) • 1.5 kB
JavaScript
import { defineComponent as p, ref as u, inject as d, watch as m, toRaw as f, createElementBlock as g, openBlock as _, createVNode as h, unref as r } from "vue";
import { pluginManager as y } from "../../../../../../utils/manager/pluginManager.js";
import "@vueuse/core";
import "../../../../../../hooks/store/index.js";
import { deepEqual as N, deepCompareAndModify as k } from "../../../../../../utils/common/data.js";
const E = { class: "epic-sound-code" }, V = /* @__PURE__ */ p({
__name: "index",
setup(v) {
const a = y.getComponent("monacoEditor"), c = u(null), t = d("designer"), s = d("designerProps");
let n = {};
m(() => t.state.checkedNode, (e) => {
var o;
N(n, f(e)) || (o = c.value) == null || o.setValue(JSON.stringify(e, null, 2));
}, {
deep: !0
});
const i = JSON.stringify(t.state.checkedNode, null, 2);
function l(e) {
try {
if (!t.state.checkedNode)
return !1;
n = JSON.parse(e), k(t.state.checkedNode, n);
} catch (o) {
console.warn("[Epic:源码]异常:", o);
}
}
return (e, o) => (_(), g("div", E, [
h(r(a), {
ref_key: "monacoEditorRef",
ref: c,
"auto-toggle-theme": "",
class: "epic-editor",
"read-only": r(s).sourceCodeReadOnly,
"model-value": r(i),
"line-numbers": "off",
"onUpdate:modelValue": l
}, null, 8, ["read-only", "model-value"])
]));
}
});
export {
V as default
};