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

否能增加一个Prop控制Image组件预览开关 #1647

Closed
Adangs opened this issue Nov 22, 2021 · 5 comments · Fixed by #1714
Closed

否能增加一个Prop控制Image组件预览开关 #1647

Adangs opened this issue Nov 22, 2021 · 5 comments · Fixed by #1714
Labels
feature request New feature or request

Comments

@Adangs
Copy link
Contributor

Adangs commented Nov 22, 2021

This function solves the problem (这个功能解决的问题)

1、当不想有预览时,目前好像只能使用Avatar或者原生img标签了
2、预览时的图片配置 max-height: 90vh; max-width: 90vw; 是否会更友好一些;当大图片时100vh 100vw太满了

Expected API (期望的 API)

@github-actions github-actions bot added the feature request New feature or request label Nov 22, 2021
@07akioni
Copy link
Collaborator

如果说不想预览的话为啥不用 img 元素?

@wuyu8512
Copy link

预览开关+1,此外我还想要固定长宽比,懒加载等功能

@07akioni
Copy link
Collaborator

此外我还想要固定长宽比,懒

说的详细点?最好有个其他组件库的 demo

@wuyu8512
Copy link

wuyu8512 commented Nov 23, 2021

此外我还想要固定长宽比,懒

说的详细点?最好有个其他组件库的 demo

https://vuetifyjs.com/zh-Hans/components/images/
用Intersection Observer实现延迟加载,有一个ratio属性可以控制图片有一个固定的长宽比,另外这个组件是图片完全加载后一瞬间显示在页面上的,同时有个占位符显示加载中

@Adangs
Copy link
Contributor Author

Adangs commented Nov 23, 2021

如果说不想预览的话为啥不用 img 元素?

Image组件应该可以再封装更深一些,

比如,
lazy-load
slot error
slot placeholder
@error
@load

参考
https://developers.weixin.qq.com/miniprogram/dev/component/image.html
https://element.eleme.cn/#/zh-CN/component/image

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

Successfully merging a pull request may close this issue.

3 participants