Skip to content

Commit b4f6e86

Browse files
committed
Adds variable image sizes to the post component.
1 parent 2435caf commit b4f6e86

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-wordpress",
3-
"version": "1.0.5",
3+
"version": "1.0.6",
44
"description": "A collection of Vue components and mixins for use with WordPress and the WP-REST API",
55
"author": "WakeCoder <[email protected]>",
66
"scripts": {

src/components/post.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</slot>
66
<div class="col-xs-12 width-auto">
77
<slot name="image">
8-
<img :src="post.imgSrcLarge" class="post-img post-img-float">
8+
<img :src="imageSource" class="post-img post-img-float">
99
</slot>
1010
<slot name="content">
1111
<div v-html="post.content" class="post-content">
@@ -23,7 +23,12 @@
2323
<script>
2424
export default {
2525
name: 'post',
26-
props: ['post']
26+
props: ['post', 'imgSize'],
27+
computed: {
28+
imageSource() {
29+
return this.getImageSource(this.post, this.imgSize)
30+
}
31+
}
2732
}
2833
2934
</script>

0 commit comments

Comments
 (0)