In Vuetify I have a v-img, and I want to change the image to a fallback one if the main one fails.
<v-img :src="cPicture" contain v-on:error="onImgError"></v-img>
cPicture : function() {
return this.failed_image ? "https://assets.dryicons.com/uploads/icon/svg/9872/ab3c0a16-6f14-4817-a30b-443273de911d.svg" : "http://myimg.jpg/";
},
onImgError : function(event) {
alert(1);
this.failed_image = true;
//this.$forceUpdate();
},
the alert 1 happens. Vuetify also throws an error in the console. But the fallback image does not show.
How can I fix this?
The main image above has intentionally a bad link, but if I use a good link, it will be shown.