[Vuejs]-Preloading and drawing an Image onto a canvas inside a Vue SPA doe snot work

0๐Ÿ‘

โœ…

A work around was adding an img to the template so it is rendered on creation and then getElementById.

<template>
...
   <img id="YOUR_ID" src="@/PATH/IMG_NAME.png" style="display: none;"/>
...
</template>

and then fetching it using a const image = document.getElementById('YOUR_ID').

Leave a comment