<img
src="{{ data_uri_thumbnail(legosFilePath, 40, 30) }}"
data-controller="symfony--ux-lazy-image--lazy-image"
data-symfony--ux-lazy-image--lazy-image-src-value="{{ asset('images/legos.jpg') }}"
alt="A blurhash image that is replaced by the real image on load"
width="578"
height="275"
style="border-radius: 5px;"
>
首先加载小尺寸(或模糊)的图片
真图(大尺寸图片)在页面加载后下载
安装它
$ composer require symfony/ux-lazy-image