show image using reactjs in laravel

。_饼干妹妹 提交于 2021-02-11 15:21:19

问题


I am doing some tiny stuffs in reactjs in a blade file of laravel. I just add react cdn and writing code within script tag. All looks good except I stuck at a point of showing image from public/assets/img folder of laravel using reactjs.

Any help is appretiated. Thanks


回答1:


You need to use the source link of your image.

For example, if laravel expose those static files under http://localhost/public/asset/img, then you need to write in your JSX:

<img src="http://localhost/public/asset/img/test.jpg" alt="test" />


来源:https://stackoverflow.com/questions/54062653/show-image-using-reactjs-in-laravel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!