Various bugfixes #40
1 changed files with 12 additions and 2 deletions
|
@ -17,16 +17,23 @@ export default class CardImage extends Vue {
|
||||||
|
|
||||||
private loaded!: boolean;
|
private loaded!: boolean;
|
||||||
private loadedURL!: string;
|
private loadedURL!: string;
|
||||||
|
private loadedTimeout!: boolean;
|
||||||
|
|
||||||
private data() {
|
private data() {
|
||||||
return {
|
return {
|
||||||
loaded: false,
|
loaded: false,
|
||||||
loadedURL: ""
|
loadedURL: "",
|
||||||
|
loadedTimeout: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private mounted() {
|
private mounted() {
|
||||||
this.fetchImage();
|
this.fetchImage();
|
||||||
|
setTimeout(() => {
|
||||||
|
if (!this.loaded) {
|
||||||
|
this.loadedTimeout = true;
|
||||||
|
}
|
||||||
|
}, 100);
|
||||||
this.$watch("id", () => {
|
this.$watch("id", () => {
|
||||||
this.loaded = false;
|
this.loaded = false;
|
||||||
this.fetchImage();
|
this.fetchImage();
|
||||||
|
@ -43,7 +50,10 @@ export default class CardImage extends Vue {
|
||||||
if (this.loaded) {
|
if (this.loaded) {
|
||||||
return this.loadedURL;
|
return this.loadedURL;
|
||||||
}
|
}
|
||||||
|
if (this.loadedTimeout) {
|
||||||
return require("@/assets/images/cardback.webp");
|
return require("@/assets/images/cardback.webp");
|
||||||
}
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue