This commit is contained in:
lhj
2024-11-09 01:18:32 +08:00
parent 898f2c3b34
commit 87d5c1fe30
8 changed files with 44 additions and 28 deletions

View File

@ -15,7 +15,7 @@
:animation="150"
:group="{ name: 'designer', pull: 'clone', put: false }"
:sort="false"
@clone="clone"
:clone="clone"
@start="onStart"
@end="onEnd"
>
@ -36,8 +36,6 @@
@update="onPreviewUpdate"
@stop="onPreviewStop"
>
{{ store.previewScheme }}
<DynamicComponent v-for="component in store.previewScheme" :key="component.id" :componentData="component">
{{ component.id }}
</DynamicComponent>
@ -52,7 +50,7 @@
</template>
<script setup lang="ts">
import {Link} from "@arco-design/web-vue";
import {DraggableEvent, VueDraggable} from "vue-draggable-plus";
import {onMounted, ref, watch} from 'vue';
import {uuid} from 'lsp-uuid';
@ -134,7 +132,7 @@ onMounted(() => {
// @ts-ignore
});
function clone(element: Record<'name' | 'id' | 'type' | 'props' | 'class' | 'text' | 'style' | 'slots', IComponent>) {
function clone(element: Record<'name' | 'id' | 'type' | 'props' | 'class' | 'text' | 'style' | 'slots'|'visible'|'disable', IComponent>) {
console.log("clone", element)
return {
id: `${element.type}-${uuid()}`,
@ -146,9 +144,9 @@ function clone(element: Record<'name' | 'id' | 'type' | 'props' | 'class' | 'tex
text: element.text,
children: [],
style: element.style,
visible: "",
visible: element.visible,
slots: element.slots,
disable: "",
disable: element.visible,
events: {},
loop: {},
};