#Problems at viewing icons on the frontend with Vue3
1 messages · Page 1 of 1 (latest)
Problems at viewing icons on the frontend with Vue3
I've tested the same code on a vanilla vue3 app, the icon appeared successfully,
Thus I concluded that this must be a problem related to laravel
What is this path? I'm 99% sure it's wrong
it's the link of the img element, it can't be wrong
/home/pc what is this? it can't be right
this is linux
so?
path needs to start from project root not your os
don't know you are using vue or inertia
imagine you deploy your app and on your server user won't be pc
then your path /home/pc automatically will be wrong
then what? you will change for every asset path? what if you 100+ files?
it didn't show the picture even when the absolute path was defined as a path
are you using plain vue or vue with inertia?
vue with inertia
okay, then where do you store your images?
at /home/pc/whistler/resources/bi
forget /home/pc
First read docs on the filesystem
especially this part https://laravel.com/docs/10.x/filesystem#the-public-disk
@dapper wolf I don't get it, how is this related to my problem?
I didn't even touch my php code yet and everything so far is on the frontend
I don't want to access the pictures via the url, I just want to make them visible in as a content in the front page and make it work as a normal frontend app
it's the same as accessing them via url
so you need to put everything in the public directory
You need to use a relative path, or use the alias. If you use the alias it would be something like @/bi/bootstrap.svg, then Vite will process the file and add it to your build automatically
but still the path wont be /home/pc/whatever...