I'm struggling to load an image using a relative path and value binding with v-for in my template code. Despite following the correct syntax, the website is displaying an error indicating that it can't retrieve the image. Here's a snippet of the code:
<Transition name="slide" v-for="Image in img4">
<img :src="Image.image" alt="img" v-if="Image.imgindex == imgdex" class="img4">
And here's the dictionary:
img4: [{image: '../assets/img/item4/page1/img1.png', imgindex: 1}, {image: "../assets/img/item4/page1/img2.jpg", imgindex: 2}, {image: "../assets/img/item4/page1/img3.png", imgindex: 3}, {image: "../assets/img/item4/page1/img4.png", imgindex: 4}]
In theory, image 1 should be displayed if the variable 'imgdex' is set to 1. However, even after removing the v-if statement, the image still fails to load. The image files are not corrupted as changing them does not resolve the issue. Is there a solution to fix this problem? (Apologies for any obvious mistakes, I am new to Vuejs)
Edit: The error message in inspect mode reads 'GET http://localhost:8080/assets/img/item4/page1/img1.png [HTTP/1.1 404 Not Found 3ms]'