Feature: Add style for image

This commit is contained in:
winkidney
2019-02-28 18:22:08 +08:00
committed by Isaac Bythewood
parent db2d7ce9ef
commit c335a3dcb8
2 changed files with 9 additions and 2 deletions

View File

@@ -13,10 +13,17 @@ Vue.component('pin', {
'editable': true, 'editable': true,
'active': false, 'active': false,
'textId': null, 'textId': null,
'imageStyle': null,
} }
}, },
props: ['pin'], props: ['pin'],
template: '#pin-template', template: '#pin-template',
mounted: function() {
this.imageStyle = {
width: this.pin.image.thumbnail.width + 'px',
height: this.pin.image.thumbnail.height + 'px',
};
},
methods: { methods: {
getInlineStyle: function() { getInlineStyle: function() {
return {}; return {};
@@ -47,7 +54,7 @@ Vue.component('pin-container', {
return { return {
"windowWidth": null, "windowWidth": null,
"blockWidth": "240px", "blockWidth": "240px",
"blockMargin": "240px", "blockMargin": "15px",
"pins": [], "pins": [],
}; };
}, },

View File

@@ -27,7 +27,7 @@
</div> </div>
</transition> </transition>
<a :href="pin.image.image" class="lightbox"> <a :href="pin.image.image" class="lightbox" :style="imageStyle">
<div class="image-wrapper"> <div class="image-wrapper">
<img :src="pin.image.thumbnail.image" v-on:load="onImageLoad"> <img :src="pin.image.thumbnail.image" v-on:load="onImageLoad">
</div> </div>