Skip to content

Commit f733cfc

Browse files
Dean OhashiDean Ohashi
authored andcommitted
reverted to vuedraggabledisplayable
1 parent 3be2ac1 commit f733cfc

File tree

1 file changed

+12
-40
lines changed

1 file changed

+12
-40
lines changed

src/components/ComponentDisplay.vue

Lines changed: 12 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="component-display">
3-
<!-- <VueDraggableResizable
3+
<VueDraggableResizable
44
class-name="component-box"
55
v-for="componentData in activeRouteArray"
66
:key="componentData.componentName"
@@ -17,35 +17,17 @@
1717
@dblclick.native="onDoubleClick(componentData)"
1818
>
1919
<h3>{{ componentData.componentName }}</h3>
20-
</VueDraggableResizable> -->
21-
<VueDragResize
22-
:isActive="true"
23-
v-for="componentData in activeRouteArray"
24-
:key="componentData.componentName"
25-
:x="componentData.x"
26-
:y="componentData.y"
27-
:w="componentData.w"
28-
:h="componentData.h"
29-
@resizing="onResize"
30-
@dragging="onDrag"
31-
@activated="onActivated(componentData)"
32-
@deactivated="onDeactivated(componentData)"
33-
@dblclick.native="onDoubleClick(componentData)"
34-
>
35-
<h3>{{ componentData.componentName }}</h3>
36-
</VueDragResize>
20+
</VueDraggableResizable>
3721
</div>
3822
</template>
3923
<script>
4024
import { mapState, mapActions } from 'vuex'
41-
// import VueDraggableResizable from 'vue-draggable-resizable'
42-
import VueDragResize from 'vue-drag-resize'
25+
import VueDraggableResizable from 'vue-draggable-resizable'
4326
4427
export default {
4528
name: 'ComponentDisplay',
4629
components: {
47-
// VueDraggableResizable
48-
VueDragResize
30+
VueDraggableResizable
4931
},
5032
data () {
5133
return {
@@ -78,25 +60,15 @@ export default {
7860
},
7961
methods: {
8062
...mapActions(['setActiveComponent', 'updateOpenModal']),
81-
// onResize: function (x, y, width, height) {
82-
// this.activeComponentData.x = x
83-
// this.activeComponentData.y = y
84-
// this.activeComponentData.w = width
85-
// this.activeComponentData.h = height
86-
// },
87-
onResize (rectangle) {
88-
this.activeComponentData.y = rectangle.top
89-
this.activeComponentData.x = rectangle.left
90-
this.activeComponentData.w = rectangle.width
91-
this.activeComponentData.h = rectangle.height
63+
onResize: function (x, y, width, height) {
64+
this.activeComponentData.x = x
65+
this.activeComponentData.y = y
66+
this.activeComponentData.w = width
67+
this.activeComponentData.h = height
9268
},
93-
// onDrag: function (x, y) {
94-
// this.activeComponentData.x = x
95-
// this.activeComponentData.y = y
96-
// },
97-
onDrag (rectangle) {
98-
this.activeComponentData.y = rectangle.top
99-
this.activeComponentData.x = rectangle.left
69+
onDrag: function (x, y) {
70+
this.activeComponentData.x = x
71+
this.activeComponentData.y = y
10072
},
10173
onActivated (componentData) {
10274
this.setActiveComponent(componentData.componentName)

0 commit comments

Comments
 (0)