问题
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