调整触发点击事件的元素
This commit is contained in:
@ -1,15 +1,14 @@
|
||||
<template>
|
||||
<div :id="componentId" @click="handleClick">
|
||||
<component :is="componentType" v-bind="componentProps" :class="componentClass" :style="componentStyle">
|
||||
{{ componentText }}
|
||||
<template v-for="child in componentChildren" :key="child.id">
|
||||
<DynamicComponent :component-data="child" />
|
||||
</template>
|
||||
<template v-for="(slot, key, index) in componentSlots" :key="index" v-slot:[key]>
|
||||
<DynamicComponent :component-data="slot" />
|
||||
</template>
|
||||
</component>
|
||||
</div>
|
||||
<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" />
|
||||
</template>
|
||||
<template v-for="(slot, key, index) in componentSlots" :key="index" v-slot:[key]>
|
||||
<DynamicComponent :component-data="slot" />
|
||||
</template>
|
||||
</component>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { defineProps, computed, onMounted } from 'vue';
|
||||
|
||||
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user