I have a table with multiple rows and a <td> loading a dynamic url image using Vuetify
<v-data-table :headers="headers" :items="items">
<template slot="items" scope="props">
<td>
<img :src="getImgUrl(props.item.styleCode)" />
</td>
</template>
</v-data-table>
and then
checkImage(imageSrc, good, bad) {
let img = new Image();
img.onload = good;
img.onerror = bad;
img.src = imageSrc;
},
getImgUrl(styleCode) {
var image = 'http://192.168.1.19/Images/ClassImages/' + styleCode + '.png';
this.checkImage(image,
function () {
return 'http://192.168.1.19/Images/ClassImages/' + styleCode + '.png';
}, function () {
return 'http://192.168.1.19/Images/ClassImages/default.png';
});
}
This return nothing. What are I doing bad?
Edit: This is to load an external image and if doesn't exist load a default image