7
7
<v-toolbar-title >Galleria</v-toolbar-title >
8
8
</v-toolbar >
9
9
<v-content >
10
- Placeholder content {{ photos.length }}
11
10
<v-layout >
12
11
<v-flex xs12 sm8 offset-sm2 >
12
+ <template v-if =" photos .length == 0 " >
13
+ <br >
14
+ <h3 >Galleria vuota!</h3 >
15
+ </template >
16
+ <template v-else >
13
17
<v-card >
14
18
<v-container grid-list-sm fluid >
15
19
<v-layout row wrap >
16
- <v-flex v-for =" n in photos.length - 1 " :key =" n" xs3 d-flex >
20
+ <v-flex v-for =" n in photos.length" :key =" n" xs3 d-flex >
17
21
<v-card flat tile class =" d-flex" >
18
-
19
- <v-img :src =" CBv1+'/photos/'+photos[n].name" aspect-ratio =" 1" class =" grey lighten-2" >
20
- <span > {{ photos[n].name }} </span >
21
- <span v-on:click =" deletePhoto(photos[n].name)" > Elimina </span >
22
- <v-layout slot =" placeholder" fill-height align-center justify-center ma-0 >
23
- <v-progress-circular indeterminate color =" grey lighten-5" ></v-progress-circular >
24
- </v-layout >
25
- </v-img >
26
- </a >
22
+ <v-layout column >
23
+ <div class =" subheading" >{{ photos[n-1].name }} <v-btn v-on:click =" deletePhoto(photos[n-1].name)" flat icon color =" red lighten-2" >
24
+ <v-icon >delete</v-icon >
25
+ </v-btn >
26
+ </div >
27
+ <v-img :src =" CBv1+'/photos/'+photos[n-1].name" aspect-ratio =" 1" class =" grey lighten-2" >
28
+ <v-layout slot =" placeholder" fill-height align-center justify-center ma-0 >
29
+ <v-progress-circular indeterminate color =" grey lighten-5" ></v-progress-circular >
30
+ </v-layout >
31
+ </v-img >
32
+ </v-layout >
27
33
</v-card >
28
34
</v-flex >
29
35
</v-layout >
30
36
</v-container >
31
37
</v-card >
38
+ </template >
32
39
</v-flex >
33
40
</v-layout >
34
41
</v-content >
@@ -41,11 +48,6 @@ import sidebar from "../components/Sidebar"
41
48
export default {
42
49
components: { sidebar },
43
50
name: ' HelloWorld' ,
44
- watch: {
45
- photosN : function () {
46
- this .l = this .photos .length
47
- }
48
- },
49
51
mounted () {
50
52
this .getPhotos ()
51
53
},
@@ -61,7 +63,7 @@ export default {
61
63
deletePhoto : function (name ) {
62
64
let axios = this .$axios
63
65
let CBv1 = this .$data .CBv1
64
- axios .delete (CBv1 + ' /photos/' + name)
66
+ axios .delete (CBv1 + ' /photos/' + name)
65
67
.then (function (response ) {
66
68
this .getPhotos ()
67
69
}.bind (this ))
@@ -83,3 +85,12 @@ export default {
83
85
};
84
86
85
87
</script >
88
+ <style scoped>
89
+ .v-card {
90
+ margin : 10px ;
91
+ }
92
+ .container {
93
+ padding-top : 0px ;
94
+ margin-top :0px ;
95
+ }
96
+ </style >
0 commit comments