0

我尝试的事情 1.simple path without URL::to 2.url() method 3.absolute path 4.asset(simple relative path) 在我的 .env 文件中将 APP_URL 从 http://localhost 更改为 http://localhost: 8000 因为它在 8000 端口上运行,所以我正在添加一些图片。当我使用简单的相对路径时,这里要提到的一件事很重要,它会在 IDE 和浏览器中显示鼠标悬停的图片,但浏览器不会在网页上呈现它。请see pictures

src="{{URL::to('public/imgs/2.png')}}"

4

1 回答 1

0

您必须将所有图像资源文件放在公共文件夹中,然后通过以下方式访问这些资源:

    src="{{ URL::asset('imgs/2.png') }}"
于 2020-11-03T07:23:34.483 回答