I am trying to dynamically load a VueJs image so that I can change it later but I keep getting a "404 not found" error.
Here is the img tag
<img class="image" :src="imageSrc" alt="image">
and the js code.
export default {
data () {
return {
imageSrc: '@/assets/gallery/images/20211005_0044.jpg'
}
}
If I put that same path directly into the img like this, it does work so the image does exist. I have also tried using ref and changing the src like that and then at first the image will load (with the path directly in the src) but as soon as I tried to change it I would get a 404 not found error back.
Note: I have seen this question Vuejs image src dynamic load doesn't work but that did not help either.
Thanks.