调整触发点击事件的元素

This commit is contained in:
lhj
2024-10-03 15:48:50 +08:00
parent 9e614657d7
commit 9fbbc8a2a7
2 changed files with 11 additions and 12 deletions

View File

@ -1,6 +1,6 @@
<template>
<div :id="componentId" @click="handleClick">
<component :is="componentType" v-bind="componentProps" :class="componentClass" :style="componentStyle">
<component @click.stop="handleClick" :id="componentId" :is="componentType" v-bind="componentProps"
:class="componentClass" :style="componentStyle">
{{ componentText }}
<template v-for="child in componentChildren" :key="child.id">
<DynamicComponent :component-data="child" />
@ -9,7 +9,6 @@
<DynamicComponent :component-data="slot" />
</template>
</component>
</div>
</template>
<script setup lang="ts">
import { defineProps, computed, onMounted } from 'vue';

View File

@ -69,7 +69,7 @@ useDraggable(el2, componentsList, {
},
clone(element) {
return {
id: uuid(),
id: `${element.type}-${uuid()}`,
name: element.name,
type: element.type,
props: element.props,