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 Request] [征求意见] uploader组件是否有必要增加widthheight参数呢? #4839

Closed
kxbin opened this issue Mar 14, 2022 · 2 comments

Comments

@kxbin
Copy link
Contributor

kxbin commented Mar 14, 2022

这个功能解决了什么问题

现在uploader组件有个参数叫做preview-size

目前uploader是将宽高都设定为preview-size指定的大小,也即宽高相同,这样的话uploader就只能是一个正方形区域。

如果我们能开放widthheight参数的话,会使其更加灵活,而不仅仅只能做成正方形。

比如现在的image组件,就是支持widthheight参数的。

建议的API是什么样的

<van-uploader
    width="200px"
    height="100px"
/>

兼容性考虑

考虑到老版本用户代码里可能有很多的preview-size,所以preview-size参数也会继续保留。

底层实现上,如果用户有指定widthheight的话,就忽略preview-size

没有指定widthheight的话,就使用preview-size顶替

@kxbin
Copy link
Contributor Author

kxbin commented Mar 14, 2022

搜索到目前有一个相关 PR #4798

@chenjiahan
Copy link
Member

相关 PR 已合并

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

2 participants