vant icon indicating copy to clipboard operation
vant copied to clipboard

[Feature Request] 建议增加表单功能,表单验证,表单绑定数据之类的..

Open YingZzz opened this issue 7 years ago • 8 comments

IMPORTANT: Please use the following link to create a new issue. If your issue was not created using the app above, it will be closed immediately.

注意:请按照下面的模板来新建 issue,不规范的 issue 会被立即关闭.

What problem does this feature solve? 现在使用vant越来越多了,但是表单验证功能,自己写的话非常痛苦..

Describe the solution you'd like 不知道是否可以像antd那样,增加表单校验的功能?

What does the proposed API look like? Describe how you propose to solve the problem and provide code samples of how the API would work once implemented.

YingZzz avatar May 24 '19 09:05 YingZzz

antd 是面向中后台的,表单场景多,所以 form 组件是必须的。

而移动端的表单相对简单,处理起来没那么麻烦,因此 vant 没提供 form 组件

不过我们会考虑在后续的版本里加一个,时间不定~

chenjiahan avatar May 24 '19 12:05 chenjiahan

这个确实可以增加这个功能

cangyu1993 avatar Jul 25 '19 03:07 cangyu1993

@YingZzz 我用async-validator 集成的field组件,专业的事情还是交给专门的框架来处理 https://gist.github.com/aiyuchen/dfcf18300eef79b9465f0719a813a7f7

cgfeel avatar Aug 23 '19 08:08 cgfeel

我用vee-validate来实现表单验证 可以与van-field组件无缝连接

stalkercn avatar Aug 28 '19 08:08 stalkercn

这个可以有,类似iview、element的Form组件,自己定义一些验证规则和触发条件就可以了,很省事。

chenmcake avatar Sep 09 '19 09:09 chenmcake

我用vee-validate来实现表单验证 可以与van-field组件无缝连接

赞成~

yulimchen avatar Sep 12 '19 09:09 yulimchen

建议增加
期待 用第三方的 总归不是太爽

Gzbox avatar Nov 14 '19 01:11 Gzbox

已在 2.5.0 版本新增 Form 组件,目前功能还比较基础,后续会持续完善

chenjiahan avatar Feb 15 '20 11:02 chenjiahan