This commit is contained in:
syuilo
2018-05-04 16:27:03 +09:00
parent f62603fd9d
commit b5acf15877
18 changed files with 109 additions and 74 deletions

View File

@ -6,12 +6,20 @@
import Vue from 'vue';
export default Vue.extend({
props: ['image'],
props: {
image: {
type: Object,
required: true
},
raw: {
default: false
}
},
computed: {
style(): any {
return {
'background-color': this.image.properties.avgColor ? `rgb(${this.image.properties.avgColor.join(',')})` : 'transparent',
'background-image': `url(${this.image.url}?thumbnail&size=512)`
'background-image': this.raw ? `url(${this.image.url})` : `url(${this.image.url}?thumbnail&size=512)`
};
}
}