epic-designer
Version:
基于vue3的设计器,可视化开发页面表单
75 lines (74 loc) • 2.48 kB
JavaScript
import { defineComponent as _, inject as r, computed as p, createElementBlock as c, openBlock as d, createCommentVNode as h, createBlock as B, unref as a } from "vue";
/* empty css */
import "vuedraggable";
import { getValueByPath as C, setValueByPath as k } from "../../../../../utils/src/common/data.js";
import "@vueuse/core";
import "../../../../../hooks/src/store/index.js";
import { pluginManager as u } from "../../../../../utils/src/manager/pluginManager.js";
const U = { class: "epic-event-view" }, E = { key: 0 }, P = /* @__PURE__ */ _({
__name: "event",
setup(V) {
const l = r("pageSchema"), i = r("designer"), m = r("revoke"), v = u.getComponent("EActionEditor"), f = u.getComponentConfings(), o = p(() => i.state.selectedNode), y = p(() => {
var n, s;
const t = [
{
events: [
{
description: "ready",
type: "epicReady"
},
{
description: "mounted",
type: "vnodeMounted"
},
{
description: "updated",
type: "vnodeUpdated"
},
{
description: "unmounted",
type: "vnodeUnmounted"
},
{
description: "beforeMount",
type: "vnodeBeforeMount"
},
{
description: "beforeUpdate",
type: "vnodeBeforeUpdate"
},
{
description: "beforeUnmount",
type: "vnodeBeforeUnmount"
},
{
description: "errorCaptured",
type: "vnodeErrorCaptured"
}
],
title: "生命周期"
}
], e = ((s = f[((n = i.state.selectedNode) == null ? void 0 : n.type) ?? ""]) == null ? void 0 : s.config.event) ?? [];
return t.unshift({
events: e,
title: "组件事件"
}), t;
});
function g(t, e) {
k(o.value, e, t), m.push(l.schemas, "编辑组件属性");
}
return (t, e) => (d(), c("div", U, [
o.value ? (d(), c("div", E, [
(d(), B(a(v), {
key: o.value.id,
"event-list": y.value,
"model-value": a(C)(o.value, "on"),
"onUpdate:modelValue": e[0] || (e[0] = (n) => g(n, "on"))
}, null, 8, ["event-list", "model-value"]))
])) : h("", !0)
]));
}
});
export {
P as default
};