feat: 新增拖拽功能

This commit is contained in:
MTrun
2022-01-30 14:20:28 +08:00
parent ef40a6347a
commit 727a0c8e8e
5 changed files with 85 additions and 26 deletions
@@ -2,7 +2,7 @@
<div
class="go-edit-range"
:style="useSizeStyle(size)"
@mousedown="mousedownHandle($event, undefined)"
@mousedown="mousedownHandleUnStop($event, undefined)"
>
<slot></slot>
</div>
@@ -10,7 +10,7 @@
<script setup lang="ts">
import { useSizeStyle } from '../../hooks/useStyle.hook'
import { mousedownHandle } from '../../hooks/useLayout.hook'
import { mousedownHandleUnStop } from '../../hooks/useLayout.hook'
const size = {
w: 1920,
@@ -37,11 +37,14 @@ const hover = computed(() => {
const select = computed(() => {
return props.item.id === chartEditStore.getTargetChart.selectIndex
})
</script>
<style lang="scss" scoped>
@include go(shape-box) {
position: absolute;
cursor: move;
.shape-modal {
position: absolute;
top: 0;
@@ -59,7 +62,7 @@ const select = computed(() => {
width: 100%;
height: 100%;
border-radius: 10px;
border: 2px solid v-bind('themeColor');
border: 1px solid v-bind('themeColor');
}
}
}