Is it possible to render an image object that has prop of source??
<template>
<div v-html="image">
{{ image }}
</div>
</template>
<script>
export default {
data () {
return {
image: new Image(),
loading: true
}
},
props: ['source'],
created () {
console.log(this.image)
if (this.image) {
this.image.onload = function (event) {
console.log(event)
}
this.image.src = this.image
}
// this.src = this.image
}
}
</script>
<style>
</style>
I just want to know if the props source is loaded then, i will render it. otherwise Ill render something else, but i didnt include it on the snippet.
Thanks!