J 6 лет назад
Родитель
Сommit
c386181f80
2 измененных файлов: 10 добавлений и 5 удалений
  1. 4
    4
      vue-theme/src/components/gallery.vue
  2. 6
    1
      vue-theme/src/pages/single.vue

+ 4
- 4
vue-theme/src/components/gallery.vue Просмотреть файл

@@ -2,10 +2,9 @@
2 2
 .gallery.f-col.center(v-if="fullscreengallery")
3 3
     button(@click="hideGallery") hide
4 4
     ul
5
-        li
6
-            h1 hello world
7
-        li
8
-            h1 hello world again
5
+        li(v-for="image of images")
6
+            div
7
+                h1 {{ image }}
9 8
     .controls.f-row
10 9
         button(@click="hideGallery") <<<
11 10
         button(@click="hideGallery") >>>
@@ -14,6 +13,7 @@
14 13
 <script>
15 14
 export default {
16 15
     props: {
16
+        images: { type: Array },
17 17
         fullscreengallery: { type: Boolean }
18 18
     },
19 19
     methods: {

+ 6
- 1
vue-theme/src/pages/single.vue Просмотреть файл

@@ -1,6 +1,6 @@
1 1
 <template lang="pug">
2 2
 .page--single.f-row.between
3
-    gallery(:fullscreengallery="fullscreengallery" v-on:close="fullscreengallery = false")
3
+    gallery(:fullscreengallery="fullscreengallery" v-on:close="fullscreengallery = false" :images="images")
4 4
     article.f-grow.shadow
5 5
         header
6 6
             h1 {{ type }}:{{ $route.params.slug }} single
@@ -61,6 +61,11 @@ export default {
61 61
                 return postsMap
62 62
             }, {})
63 63
         },
64
+        images () {
65
+            console.log(this.posts[this.$route.params.slug])
66
+            return ['hi', 'hello']
67
+        },
68
+
64 69
     },
65 70
     mounted() {
66 71
         // TODO: this should be conditional after checking vuex state

Загрузка…
Отмена
Сохранить