[Vuejs]-Vue: get image width + height returns zero on component load

1👍

You could load the image first via javascript, and after it’s loaded run the renderTags method.

E.g., do something like this:

async mounted() {
    let image = new Image();
    image.onload = function () {
        this.renderTags(this.media.tags)   
    };
    image.src = 'https://some-image.png'
}

Leave a comment