@@ -13,40 +13,8 @@ Description:
1313 >
1414 <!-- This is the actual component box -->
1515 <!-- 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"
5018 v-for =" componentData in activeRouteArray"
5119 ref =" boxes"
5220 :key =" componentData.componentName"
@@ -101,15 +69,7 @@ Description:
10169 </q-item >
10270 </q-list >
10371 </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 >
11373 <div >
11474 <q-dialog v-model =" modalOpen" >
11575 <q-select
@@ -130,20 +90,16 @@ Description:
13090</template >
13191
13292<script >
133- import { defineComponent } from " vue"
13493import { 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'
13696
137- // import { DraggableContainer } from 'vue3-draggable-resizable'
138- // import VueDraggableResizable from "vue-draggable-resizable";
139- // import "vue-draggable-resizable/dist/VueDraggableResizable.css";
14097const cloneDeep = require (' lodash.clonedeep' )
14198
142-
14399export default {
144100 name: " ComponentDisplay" ,
145101 components: {
146- // Vue3DraggableResizable
102+ VueDraggableResizable
147103 },
148104 data () {
149105 // console.log("Current Component Map is: ", this.componentMap);
@@ -204,6 +160,7 @@ export default {
204160 activeComponentData () {
205161 // Must deep clone this so we are not directly mutating state
206162 return cloneDeep (this .activeComponentObj );
163+ // return this.activeComponentObj;
207164 },
208165 // childList () {
209166 // return this.componentMap[componentData.componentName].children
@@ -262,10 +219,10 @@ export default {
262219 this .$refs .boxes .forEach (element => {
263220 element .enabled = false ;
264221
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);
269226 });
270227 }
271228 } else {
@@ -278,10 +235,10 @@ export default {
278235 element .enabled === false
279236 ) {
280237 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);
285242 }
286243 });
287244 }
@@ -385,12 +342,10 @@ export default {
385342 if (element .id !== componentData .componentName ) {
386343 console .log (' Emit' )
387344 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);
394349 }
395350 });
396351 }
0 commit comments