Skip to content

Commit

Permalink
refactor: asynchronous loading form-render-editor
Browse files Browse the repository at this point in the history
  • Loading branch information
chensuifengran committed Nov 5, 2024
1 parent f9e00ea commit bb1714a
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/views/editor/BuildFormEditorPanel.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
<template>
<el-drawer
v-model="visible"
title="表单编辑器"
title="表单编辑器(右键分组或组件增删改,左键长按拖动进行排序)"
direction="rtl"
size="70%"
:before-close="handleClose"
>
<form-render-editor v-model="formData" />
<async-form-render-editor v-model="formData" />
</el-drawer>
</template>
<script lang="ts" setup>
import Loading from "../../components/Loading.vue";
const AsyncFormRenderEditor = defineAsyncComponent({
loader: () => import("./FormRenderEditor.vue"),
loadingComponent: Loading,
});
const { formData } = useRenderItemEditForm();
const visible = AutoTipUtils.buildFormEditorVisible;
const handleClose = (done: () => void) => {
ElMessageBox.confirm("是否应用修改?")
ElMessageBox.confirm("是否应用修改?", {
confirmButtonText: "应用",
cancelButtonText: "取消",
})
.then(() => {
const { dynamicDialog } = useCore();
dynamicDialog.callback();
Expand All @@ -22,7 +31,6 @@ const handleClose = (done: () => void) => {
done();
});
};
const formData = ref<RenderGroup[]>([]);
watch(
() => formData.value,
(newData) => {
Expand Down

0 comments on commit bb1714a

Please sign in to comment.