@@ -13,40 +13,8 @@ Description:
13
13
>
14
14
<!-- This is the actual component box -->
15
15
<!-- https://www.npmjs.com/package/vue-draggable-resizable -->
16
-
17
- <!-- // ***************** Without draggable resizable, this works *********** -->
18
- <!-- <div
19
- class="component-box"
20
- v-for="componentData in activeRouteArray"
21
- ref="boxes"
22
- :key="componentData.componentName"
23
- :id="componentData.componentName"
24
- :x="componentData.x"
25
- :y="componentData.y"
26
- :z="componentData.z"
27
- :w="componentData.w"
28
- :h="componentData.h"
29
- :parent="true"
30
- :preventDeactivation="true"
31
- @activated="onActivated(componentData)"
32
- @click="onActivated(componentData)"
33
- @deactivated="onDeactivated(componentData)"
34
- @dragstop="finishedDrag"
35
- @resizestop="finishedResize"
36
- :onDragStart="recordInitialPosition"
37
- :onResizeStart="recordInitialSize"
38
- >
39
- {{ componentData.componentName }}
40
- {{ componentData.w }}
41
- {{ componentData.x }}
42
- {{ componentData.y }}
43
- {{ componentData.z }}
44
- {{ componentData.h }}
45
- </div> -->
46
-
47
- <!-- ************************** Old vue draggable resizable *************** -->
48
- <!-- <vue-draggable-resizable
49
- class="component-box"
16
+ <vue-draggable-resizable
17
+ class-name =" component-box"
50
18
v-for =" componentData in activeRouteArray"
51
19
ref =" boxes"
52
20
:key =" componentData.componentName"
@@ -101,15 +69,7 @@ Description:
101
69
</q-item >
102
70
</q-list >
103
71
</q-menu >
104
- </vue-draggable-resizable> -->
105
-
106
-
107
-
108
- <!-- ************************ Vue3 draggable resizable ******************* -->
109
-
110
-
111
-
112
- <!-- ********************* This part works, don't touch it *************** -->
72
+ </vue-draggable-resizable >
113
73
<div >
114
74
<q-dialog v-model =" modalOpen" >
115
75
<q-select
@@ -130,20 +90,16 @@ Description:
130
90
</template >
131
91
132
92
<script >
133
- import { defineComponent } from " vue"
134
93
import { mapState , mapActions } from " vuex" ;
135
- // import Vue3DraggableResizable from 'vue3-draggable-resizable';
94
+ import VueDraggableResizable from ' vue-draggable-resizable/src/components/vue-draggable-resizable.vue'
95
+ import ' vue-draggable-resizable/src/components/vue-draggable-resizable.css'
136
96
137
- // import { DraggableContainer } from 'vue3-draggable-resizable'
138
- // import VueDraggableResizable from "vue-draggable-resizable";
139
- // import "vue-draggable-resizable/dist/VueDraggableResizable.css";
140
97
const cloneDeep = require (' lodash.clonedeep' )
141
98
142
-
143
99
export default {
144
100
name: " ComponentDisplay" ,
145
101
components: {
146
- // Vue3DraggableResizable
102
+ VueDraggableResizable
147
103
},
148
104
data () {
149
105
// console.log("Current Component Map is: ", this.componentMap);
@@ -204,6 +160,7 @@ export default {
204
160
activeComponentData () {
205
161
// Must deep clone this so we are not directly mutating state
206
162
return cloneDeep (this .activeComponentObj );
163
+ // return this.activeComponentObj;
207
164
},
208
165
// childList () {
209
166
// return this.componentMap[componentData.componentName].children
@@ -262,10 +219,10 @@ export default {
262
219
this .$refs .boxes .forEach (element => {
263
220
element .enabled = false ;
264
221
265
- // element.$emit("deactivated");
266
- // element.$emit("update:active", false);
267
- this .$emit (" deactivated" );
268
- this .$emit (" update:active" , false );
222
+ element .$emit (" deactivated" );
223
+ element .$emit (" update:active" , false );
224
+ // this.$emit("deactivated");
225
+ // this.$emit("update:active", false);
269
226
});
270
227
}
271
228
} else {
@@ -278,10 +235,10 @@ export default {
278
235
element .enabled === false
279
236
) {
280
237
element .enabled = true ;
281
- // element.$emit("activated");
282
- // element.$emit("update:active", true);
283
- this .$emit (" activated" );
284
- this .$emit (" update:active" , true );
238
+ element .$emit (" activated" );
239
+ element .$emit (" update:active" , true );
240
+ // this.$emit("activated");
241
+ // this.$emit("update:active", true);
285
242
}
286
243
});
287
244
}
@@ -385,12 +342,10 @@ export default {
385
342
if (element .id !== componentData .componentName ) {
386
343
console .log (' Emit' )
387
344
element .enabled = false ;
388
- // element.$emit("deactivated");
389
-
390
- // element.$emit("update:active", false);
391
- this .$emit (" deactivated" );
392
-
393
- this .$emit (" update:active" , false );
345
+ element .$emit (" deactivated" );
346
+ element .$emit (" update:active" , false );
347
+ // this.$emit("deactivated");
348
+ // this.$emit("update:active", false);
394
349
}
395
350
});
396
351
}
0 commit comments