7
7
:key =" componentData.componentName"
8
8
:x =" componentData.x"
9
9
:y =" componentData.y + 20"
10
+ :z =" componentData.z"
10
11
:w =" componentData.w"
11
12
:h =" componentData.h"
12
13
:parent =" true"
25
26
<!-- <p v-for="child in childList" :key="childList.indexOf(child)"> {{ child.text }}</p> -->
26
27
</ul >
27
28
<q-menu context-menu >
28
- <q-list class =" menu" >
29
+ <q-list color = ' black ' class =" menu" >
29
30
<q-item clickable v-ripple v-close-popup @click =" handleAddChild" >
30
31
<q-item-section style =" color : white " >Update Children</q-item-section >
31
32
<q-item-section avatar >
32
33
<q-icon color =" primary" name =" add" />
33
34
</q-item-section >
34
35
</q-item >
35
- <!-- <q-item clickable v-ripple v-close-popup auto-close>
36
- <q-item-section style="color: pink">Delete Children</q-item-section>
37
- <q-item-section avatar>
38
- <q-icon color="primary" name="delete" />
39
- </q-item-section>
40
- </q-item> -->
36
+ <q-item clickable v-ripple v-close-popup >
37
+ <q-item-section class =' layer' style =" color : pink " >Layer</q-item-section >
38
+ <q-btn class =' btn' color =' transparent' text-color =' primary' label =' -' @click =' (e)=>handleLayer(e)' />
39
+ <p id =' counter' style =" color : white " > {{componentData.z}} </p >
40
+ <q-btn class =' btn' color =' transparent' text-color =' primary' label =' +' @click =' (e)=>handleLayer(e)' />
41
+ <!-- <q-item-section avatar>
42
+ <q-icon color="primary" name="layer" />
43
+ </q-item-section> -->
44
+ </q-item >
41
45
</q-list >
42
46
</q-menu >
43
47
</VueDraggableResizable >
@@ -77,7 +81,8 @@ export default {
77
81
abilityToDelete: false ,
78
82
testOptions: [" parent" , " child" , " grandchild" ],
79
83
testModel: [],
80
- mockImg: false
84
+ mockImg: false ,
85
+ counter: 0
81
86
};
82
87
},
83
88
mounted () {
@@ -191,6 +196,9 @@ export default {
191
196
this .componentMap [this .activeComponent ].y = y;
192
197
this .userImage ;
193
198
},
199
+ onLayer : function (z ) {
200
+ this .activeComponentData .z = z;
201
+ },
194
202
onActivated (componentData ) {
195
203
this .setActiveComponent (componentData .componentName );
196
204
this .activeComponentData .isActive = true ;
@@ -211,6 +219,23 @@ export default {
211
219
console .log (" Multiselect: " , value);
212
220
this .updateActiveComponentChildrenValue (value);
213
221
// this.updateComponentChildrenMultiselectValue(value)
222
+ },
223
+ handleLayer (e ){
224
+ e .preventDefault ()
225
+ console .log (' event object' , e .target .innerText )
226
+ console .log (' Layer handled' )
227
+
228
+ if (e .target .innerText === ' +' ){
229
+ this .counter ++ ;
230
+ // this.activeComponentData.z = z;
231
+ }
232
+ if (e .target .innerText === ' -' && this .counter > 0 ){
233
+ this .counter -- ;
234
+ }
235
+ console .log (' counter' , this .counter )
236
+ this .activeComponentData .z = this .counter ;
237
+ this .componentMap [this .activeComponent ].z = this .counter ;
238
+
214
239
}
215
240
// @dblclick.native="onDoubleClick(componentData)"
216
241
// onDoubleClick (compData) {
@@ -233,6 +258,7 @@ export default {
233
258
/* width: 1rem; */
234
259
line-height : 1.2 ;
235
260
/* margin: 10px; */
261
+ z-index : 0 ;
236
262
}
237
263
.component-children {
238
264
position : absolute ;
@@ -293,4 +319,23 @@ export default {
293
319
background-color : rgba (105 , 179 , 190 , 0.514 );
294
320
border : 1px dashed rgb (227 , 203 , 71 );
295
321
}
322
+ .btn {
323
+ font-size : 25px ;
324
+ /* margin-top: 0;
325
+ margin-bottom: 0; */
326
+ padding : 0 20px ;
327
+ width : 10px ;
328
+ height : 10px ;
329
+ transition : none ;
330
+ }
331
+ .btn :hover , .btn :focus , .btn :active {
332
+ color : white ;
333
+ background-color : transparent ;
334
+ }
335
+ #counter {
336
+ margin-top : 20px ;
337
+ }
338
+ /* .layer {
339
+ padding: 0 20px;
340
+ } */
296
341
</style >
0 commit comments