11<template >
2- <div class =" component-display" >
2+ <div class =" component-display grid-bg" :style =" mockBg" >
3+ <!-- <p>{{ userImage }}</p> -->
34 <VueDraggableResizable
45 class-name =" component-box"
56 v-for =" componentData in activeRouteArray"
1516 @resizing =" onResize"
1617 @dblclick.native =" onDoubleClick(componentData)"
1718 >
18- <div class =" component-title" >
19+ <div class =" component-title" >
1920 <p >{{ componentData.componentName }}</p >
2021 </div >
2122 <ul class =" component-children" >
22- <li ># of children: {{ componentMap[componentData.componentName].children.length }} </li >
23+ <li ># of children: {{ componentMap[componentData.componentName].children.length }}</li >
2324 <li >children: {{ componentMap[componentData.componentName].children }}</li >
24- <!-- <p v-for="child in childList" :key="childList.indexOf(child)"> {{ child.text }}</p> -->
25+ <!-- <p v-for="child in childList" :key="childList.indexOf(child)"> {{ child.text }}</p> -->
2526 </ul >
26- <q-menu context-menu >
27+ <q-menu context-menu >
2728 <q-list class =" menu" >
2829 <q-item clickable v-ripple v-close-popup @click =" handleAddChild" >
2930 <q-item-section >Add Children</q-item-section >
30- <q-item-section avatar ><q-icon color =" primary" name =" add" /></q-item-section >
31+ <q-item-section avatar >
32+ <q-icon color =" primary" name =" add" />
33+ </q-item-section >
3134 </q-item >
3235 <q-item clickable v-ripple v-close-popup auto-close >
3336 <q-item-section >Delete Children</q-item-section >
34- <q-item-section avatar ><q-icon color =" primary" name =" delete" /></q-item-section >
37+ <q-item-section avatar >
38+ <q-icon color =" primary" name =" delete" />
39+ </q-item-section >
3540 </q-item >
3641 </q-list >
3742 </q-menu >
@@ -70,7 +75,8 @@ export default {
7075 modalOpen: false ,
7176 abilityToDelete: false ,
7277 testOptions: [' parent' , ' child' , ' grandchild' ],
73- testModel: []
78+ testModel: [],
79+ mockImg: false
7480 }
7581 },
7682 mounted () {
@@ -85,7 +91,14 @@ export default {
8591 })
8692 },
8793 computed: {
88- ... mapState ([' routes' , ' activeRoute' , ' activeComponent' , ' componentMap' , ' componentChildrenMultiselectValue' ]),
94+ ... mapState ([
95+ ' routes' ,
96+ ' activeRoute' ,
97+ ' activeComponent' ,
98+ ' componentMap' ,
99+ ' componentChildrenMultiselectValue' ,
100+ ' imagePath'
101+ ]),
89102 // used in VueDraggableResizeable component
90103 activeRouteArray () {
91104 console .log (' active route array method' , this .routes [this .activeRoute ])
@@ -107,13 +120,28 @@ export default {
107120 return Object .keys (this .componentMap ).filter (component => {
108121 if (! exceptions .has (component)) return component
109122 })
123+ },
124+ userImage () {
125+ const imgSrc = this .imagePath .length ? ` file://` + this .imagePath [0 ] : ' '
126+ // const imgSrc1 = this.imagePath;
127+ console .log (` imgSrc: ${ imgSrc} ` )
128+ return imgSrc
129+ },
130+ mockBg () {
131+ return this .imagePath .length
132+ ? {
133+ background: ` url("${ this .userImage } ") no-repeat center` ,
134+ ' background-size' : ' cover'
135+ }
136+ : {}
110137 }
111138 },
112139 methods: {
113140 ... mapActions ([
114141 ' setActiveComponent' ,
115142 ' updateComponentChildrenMultiselectValue' ,
116- ' updateActiveComponentChildrenValue' ]),
143+ ' updateActiveComponentChildrenValue'
144+ ]),
117145 onResize : function (x , y , width , height ) {
118146 this .activeComponentData .x = x
119147 this .activeComponentData .y = y
@@ -131,6 +159,7 @@ export default {
131159
132160 this .componentMap [this .activeComponent ].x = x
133161 this .componentMap [this .activeComponent ].y = y
162+ this .userImage
134163 },
135164 onActivated (componentData ) {
136165 this .setActiveComponent (componentData .componentName )
@@ -190,8 +219,10 @@ export default {
190219 height : 90vh ;
191220 width : 100% ;
192221 position : relative ;
193- background : darkslategray ;
194- background-color : rgba (124 , 126 , 145 , 0.44 );
222+ /* background: rgb(211, 211, 210); */
223+ }
224+ .grid-bg {
225+ background-color : rgba (223 , 218 , 218 , 0.886 );
195226 /* background-color: #269; */
196227 background-size : 100px 100px , 100px 100px , 20px 20px , 20px 20px ;
197228 background-position : -2px -2px , -2px -2px , -1px -1px , -1px -1px ;
@@ -216,6 +247,7 @@ export default {
216247 #269 ;
217248 behavior : url (/pie/PIE.htc );
218249}
250+
219251.menu {
220252 margin-bottom : 0px !important ;
221253}
0 commit comments