I have exhausted all options in my Vue app, but I am still unable to load the background image in my app.vue file. Despite getting the .html file to work with it, the image just won't show up. I've scoured the internet for solutions without success. Let's dive right into the problem.
background-image: url("/@/components/images/Cover1.jpg");
This code seems to have no effect.
I even tried adding a background color, and that worked perfectly fine. Everything shows up except the image. I suspect the issue lies within the path. I've attempted various formats from ~@/components/images/Cover1.jpg to /components/images/Cover1.jpg, but nothing seems to work. Oddly enough, using both /components/images/Cover1.jpg and /@/components/images/Cover1.jpg does not produce any errors in Vue.js.
Here is the folder structure containing the image I need:
(2 errors are due to a Vetur bug and are unrelated to the tag) I am designing the website layout from the tag in app.vue
I have also tested the image loading in a standard HTML and CSS file
folder:
.images
.index.html
.styles.css
In this file structure and normal HTML/CSS file
background-image: url("images/Cover1.jpg");
The above code works just fine, but the one in app.vue causes issues. Any guidance on what steps to take next would be greatly appreciated.