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