I'm using Webpack to compile my Vue production bundle and it loads my images properly because they are defined used <img>
tags in my component. I want to load an additional image and show it based on a condition. Since the image isn't set initially in an <img>
tag Webpack isn't loading it using file-loader. When I call:
event.currentTarget.children[2].innerHTML = "<img src='../assets/imgs/heart.png' />"
This doesn't work because heart.png was never processed by file-loader, while my previous images were. Any ideas on how to force Webpack to process this image without defining it in HTML my component. My other images (that work) look like this : <img src="data:image/png;base64,iVBORw0KGgo...==">
I understand why my image isn't loading (it's defined in a string), buy any suggestions?