简体   繁体   English

当可见性设置为隐藏时,Next.js 中的图像是否延迟加载?

[英]Are images in Next.js lazy loaded when visibility is set to hidden?

Are images in Next.js lazy loaded when visibility is set to hidden?当可见性设置为隐藏时,Next.js 中的图像是否延迟加载? If that is not the case I would want to make them lazy load.如果不是这种情况,我想让它们延迟加载。 I know I can use the priority prop but I want them to load in a specified viewport position.我知道我可以使用优先级道具,但我希望它们加载到指定的视口 position 中。

All Images inside Image components in Next js are lazy loaded by default and it not going to change with visibility or other styling properties. Next jsImage components中的所有图像默认情况下都是延迟加载的,并且不会随着可见性或其他样式属性而改变。 Only priority prop will change the behavior.只有优先级道具会改变行为。

Also for more confidence I recommend you analyze the Network tab and see the behavior of your images.另外,为了更有信心,我建议您分析“ Network ”选项卡并查看图像的行为。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM