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

[Feature] Picture 支持传入占位元素 #397

Open
fengzilong opened this issue Aug 31, 2021 · 0 comments
Open

[Feature] Picture 支持传入占位元素 #397

fengzilong opened this issue Aug 31, 2021 · 0 comments

Comments

@fengzilong
Copy link

fengzilong commented Aug 31, 2021

目前 Picture 支持传入 placeholder,但是必须是一个占位图片地址

假如我们有一个数量上千的品牌列表页,需要一次性展示,即使用了 Picture 的懒加载,但是并发几百个 1x1 占位图片请求,仍然会存在明显的卡顿,这里用虚拟窗口也可以解决,但相对比较复杂

针对上述这种大量图片的场景,希望 Picture 组件 除了支持占位图片外,也可以支持传入占位元素(比如带背景色的 div)

如果没问题的话,我可以提个 PR

大概实现思路是判断 props.placeholder 的类型是字符串,还是 Rax 组件

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

No branches or pull requests

1 participant