Hello, I am new to F7 vue.
In my src folder, I have a folder named images in which I am keeping all my app images.
I also have media folder with mp3 files.
In some component, I do something like :
Structure:
src
pages
*some-component.vue
images
<img :src="imageLink" alt=""/>
And in my data:
imageLink: '../images/logo/white-trans.png',
Issue is: It keeps reading it as http://localhost:8081/images/logos/white-trans.png and concluding that It doesn’t exist… I am not a webpack pro, I am not sure how to solved the issue… I would like to know how to go about this.
@pvtallulah, I have tried out your solution, it no more brings the 404 error but then It doesnt work, I tried to console.log() the img data property and it is changes the image name in a weird manner.
basically url-loader will look for any img that matches test prop in config. And if the image is bigger tahn limit (in bytes) it will hash it and put it in images folder. so every image, no matter from where you import it will be hashed. in that way you can have several images with the same name when you are codding, and will be hashed at build time
eg:
dev, you import this images to your template:
max, just test it on my pc. windows environment. it workjs fine with default f7 template options.
with default options you get 404 on the image? or you dont see the image?. bcs at firs it was strange that i didnt get any console error. but also didnt see the image. then inspect img tag and this is what i get:
Yeah, this is how things work in webpack, it automatically moves such images (and add hash to file name). Not sure it must be used with import, i use require() for such things.
That is why there is also the static folder in project, it just copies all files intact that you can also reference