|
1 | 1 | <template> |
2 | 2 | <div class="component-display"> |
3 | | - <!-- <VueDraggableResizable |
| 3 | + <VueDraggableResizable |
4 | 4 | class-name="component-box" |
5 | 5 | v-for="componentData in activeRouteArray" |
6 | 6 | :key="componentData.componentName" |
|
17 | 17 | @dblclick.native="onDoubleClick(componentData)" |
18 | 18 | > |
19 | 19 | <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> |
37 | 21 | </div> |
38 | 22 | </template> |
39 | 23 | <script> |
40 | 24 | 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' |
43 | 26 |
|
44 | 27 | export default { |
45 | 28 | name: 'ComponentDisplay', |
46 | 29 | components: { |
47 | | - // VueDraggableResizable |
48 | | - VueDragResize |
| 30 | + VueDraggableResizable |
49 | 31 | }, |
50 | 32 | data () { |
51 | 33 | return { |
@@ -78,25 +60,15 @@ export default { |
78 | 60 | }, |
79 | 61 | methods: { |
80 | 62 | ...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 |
92 | 68 | }, |
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 |
100 | 72 | }, |
101 | 73 | onActivated (componentData) { |
102 | 74 | this.setActiveComponent(componentData.componentName) |
|
0 commit comments