Просмотр исходного кода

:sparkles: address #81 | prop for feature-image component

tags/0.9.0
j 4 лет назад
Родитель
Сommit
0c111c6fc6
1 измененных файлов: 11 добавлений и 5 удалений
  1. 11
    5
      vue-theme/src/components/featured-image.vue

+ 11
- 5
vue-theme/src/components/featured-image.vue Просмотреть файл

@@ -14,7 +14,10 @@ import { ytThumbnail } from '@/utils/helpers'
14 14
 
15 15
 export default {
16 16
     props: {
17
-        post: { required: true }
17
+        post: { required: true },
18
+        thumbsize: {
19
+            type: String,
20
+        },
18 21
     },
19 22
     computed: {
20 23
         featured() {
@@ -24,13 +27,16 @@ export default {
24 27
             return this.post.thumb ? this.post.thumb : null
25 28
         },
26 29
         hero() {
27
-            return this.post.hero && JSON.parse(this.post.hero) ? JSON.parse(this.post.hero) : null
28
-        }
30
+            return this.post.hero && JSON.parse(this.post.hero)
31
+                ? JSON.parse(this.post.hero)
32
+                : null
33
+        },
29 34
     },
30 35
     methods: {
31 36
         getThumbnailFromYt(url) {
37
+            let size = this.thumbsize ? this.thumbsize : 'max'
32 38
             return ytThumbnail(url, 'max')
33
-        }
34
-    }
39
+        },
40
+    },
35 41
 }
36 42
 </script>

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