I am calling this "display" function in Vue.js, which loads an image. I am using img.onload in order to verify when the image has completed its loading. However, the code never reaches the console.log line. What am I missing?
<input type="button" name="display" value="Display" v-on:click="display" />
display () {
var img = new Image()
img.onload = function () {
console.log('Loaded')
}
img.src = '../Image.jpg'
}
Thank you. J