Explorar el Código

example indexing gallery

tags/0.9.0
J hace 6 años
padre
commit
669ba46b26

+ 1
- 1
vue-theme/src/app.vue Ver fichero

83
                             &-grid
83
                             &-grid
84
                                 list-style: none
84
                                 list-style: none
85
                             &-item
85
                             &-item
86
-                                loat: left
86
+                                float: left
87
                         &.columns-1
87
                         &.columns-1
88
                             .blocks-gallery-item
88
                             .blocks-gallery-item
89
                                 width: 100%
89
                                 width: 100%

+ 2
- 1
vue-theme/src/components/gallery.vue Ver fichero

4
     ul
4
     ul
5
         li(v-for="(image, i) of images" :class="{ active: i === selected }")
5
         li(v-for="(image, i) of images" :class="{ active: i === selected }")
6
             .image-wrapper.f-col.center
6
             .image-wrapper.f-col.center
7
-                img(:src="image")
7
+                h1 {{ i }}
8
+                //- img(:src="image")
8
     .controls.f-row
9
     .controls.f-row
9
         button(@click="prev") <
10
         button(@click="prev") <
10
         .f-grow
11
         .f-grow

+ 2
- 7
vue-theme/src/pages/single.vue Ver fichero

62
                 return postsMap
62
                 return postsMap
63
             }, {})
63
             }, {})
64
         },
64
         },
65
-        images () {
66
-            console.log(this.posts[this.$route.params.slug])
67
-            return ['hi', 'hello']
68
-        },
69
-
70
     },
65
     },
71
     methods: {
66
     methods: {
72
         checkForImages(posts) {
67
         checkForImages(posts) {
78
                 const doc = new DOMParser().parseFromString(block, 'text/html')
73
                 const doc = new DOMParser().parseFromString(block, 'text/html')
79
                 const gallery = doc.querySelectorAll('.blocks-gallery-item img')
74
                 const gallery = doc.querySelectorAll('.blocks-gallery-item img')
80
                 if(gallery) {
75
                 if(gallery) {
81
-                    this.images = [].slice.call(gallery).map(item => { 
82
-                        return item.src }
76
+                    this.images = [].slice.call(gallery).map(
77
+                        item => {  return item.src }
83
                     )
78
                     )
84
                 }
79
                 }
85
             })
80
             })

Loading…
Cancelar
Guardar