リモートサーバーのファイルをデータベースに保存せず、クライアントで直接表示させられるように

This commit is contained in:
syuilo
2018-05-25 20:19:14 +09:00
parent e804757d83
commit 558b897700
10 changed files with 110 additions and 60 deletions

View File

@ -16,13 +16,18 @@ export default Vue.extend({
}
},
computed: {
lightmode(): boolean {
return this.$store.state.device.lightmode;
},
style(): any {
let url = `url(${this.image.url}?thumbnail)`;
if (this.$store.state.device.loadRemoteMedia || this.$store.state.device.lightmode) {
url = null;
} else if (this.raw || this.$store.state.device.loadRawImages) {
url = `url(${this.image.url})`;
}
return {
'background-color': this.image.properties.avgColor && this.image.properties.avgColor.length == 3 ? `rgb(${this.image.properties.avgColor.join(',')})` : 'transparent',
'background-image': this.lightmode ? null : this.raw ? `url(${this.image.url})` : `url(${this.image.url}?thumbnail&size=512)`
'background-image': url
};
}
}