Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] [Bug Report] el-image 添加 loading="lazy" 图片原生懒加载后图片不显示 #22873

Open
xiayefeng opened this issue May 11, 2024 · 2 comments · May be fixed by #22879
Open

Comments

@xiayefeng
Copy link

Element UI version

2.15.14

OS/Browsers version

win10/ 109.0.5414.120

Vue version

2.7.16

Reproduction Link

https://codepen.io/ziyoung/pen/LKNBqB

Steps to reproduce

如链接

What is Expected?

加上 loading="lazy"属性后图片可以正常显示

What is actually happening?

加上 loading="lazy"属性后图片不显示

@shay-an
Copy link

shay-an commented May 14, 2024

微信图片_20240514164410
这里是加载图片的代码,这里的图片并未放到dom中,当给图片标签加上 loading="lazy" 且没有添加到dom中,onload onerror 方法就不会执行。建议可以使用el-image的 :lazy="true" 实现图片懒加载

@shay-an shay-an linked a pull request May 15, 2024 that will close this issue
@xiayefeng
Copy link
Author

:lazy="true" 有性能问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants