Ver código fonte

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

tags/0.9.0
j 4 anos atrás
pai
commit
0c111c6fc6
1 arquivos alterados com 11 adições e 5 exclusões
  1. 11
    5
      vue-theme/src/components/featured-image.vue

+ 11
- 5
vue-theme/src/components/featured-image.vue Ver arquivo

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

Carregando…
Cancelar
Salvar