How to render a javascript image object in the view using VueJs. I have added a sample code below. But the "v-html" tag is not rendering the image.
<div id="test">
<span v-html="imageTemp"></span>
</div>
<script>
new Vue({
el: "#test",
data: {
imageTemp: new Image()
},
mounted: function() {
this.imageTemp.src = "/temp.png"
}
});
</script>
What is the best method to do this?
I know how to render an image using "v-bind:src".
Also, using jQuery it is possible to add the image object to the view using: $("#test").append(this.imageTemp);
I would like to know whether there is a way to render the javascript image object on the view using VueJs.