fix: 处理层级右键拖拽的问题

This commit is contained in:
奔跑的面条 2022-08-15 20:11:04 +08:00
parent f70576bbdc
commit 0d3585503b
3 changed files with 6 additions and 7 deletions

View File

@ -123,8 +123,6 @@ const hover = computed(() => {
//
const groupMousedownHandle = (e: MouseEvent) => {
e.preventDefault()
e.stopPropagation()
onClickOutSide()
// CTRL,
const id = props.componentGroupData.id

View File

@ -60,7 +60,7 @@ $textSize: 10px;
position: relative;
height: $centerHeight;
width: 90%;
margin: 10px 5%;
margin: 5px 5%;
margin-bottom: 5px;
border-radius: 5px;
cursor: pointer;

View File

@ -19,7 +19,7 @@
<!-- https://github.com/SortableJS/vue.draggable.next -->
<draggable item-key="id" v-model="reverseList" ghostClass="ghost" @change="onMoveCallback">
<template #item="{ element }">
<div>
<div class="go-content-layer-box">
<!-- 组合 -->
<layers-group-list-item v-if="element.isGroup" :componentGroupData="element"></layers-group-list-item>
<!-- 单组件 -->
@ -112,13 +112,14 @@ const onMoveCallback = (val: any) => {
}
const boxMousedownHandle = (e: MouseEvent) => {
chartEditStore.setTargetSelectChart()
const box = document.querySelector('.go-content-layer-box')
if ((e.target as any).contains(box)) {
chartEditStore.setTargetSelectChart()
}
}
//
const mousedownHandle = (e: MouseEvent, item: CreateComponentType) => {
e.preventDefault()
e.stopPropagation()
onClickOutSide()
// CTRL,
const id = item.id