0

I tried add and image on my vue component :

<img src="/storage/app/product_images/up.png" alt="">

but i get this error:

enter image description here

and i am sure that the file exist.

enter image description here

this a laravel / vue project.

2
  • you can also pass image as base64 in API, just create an image in the backend and converted it into base64 and pass it, nobody knows about your project directory structure as well. Commented Aug 23, 2021 at 22:12
  • @GauravGupta why would you pass the images as base64? That will make the API responses bigger and slower. Since it's a Laravel app, the project structure is clear. He just needs to use the storage public dir. Commented Aug 24, 2021 at 7:53

1 Answer 1

1

Try placing pictures in the public/img/

And in Vue component use path like this

<img src="/img/product_images/up.png" alt="">

Here you can see the details of my answer

And here are other options for using pictures in a bundle of Laravel and Vue

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.