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.
antd 是面向中后台的,表单场景多,所以 form 组件是必须的。
而移动端的表单相对简单,处理起来没那么麻烦,因此 vant 没提供 form 组件
不过我们会考虑在后续的版本里加一个,时间不定~
这个确实可以增加这个功能
@YingZzz 我用async-validator 集成的field组件,专业的事情还是交给专门的框架来处理
https://gist.github.com/aiyuchen/dfcf18300eef79b9465f0719a813a7f7
我用vee-validate来实现表单验证 可以与van-field组件无缝连接
这个可以有,类似iview、element的Form组件,自己定义一些验证规则和触发条件就可以了,很省事。
我用vee-validate来实现表单验证 可以与van-field组件无缝连接
赞成~
建议增加
期待
用第三方的 总归不是太爽
已在 2.5.0 版本新增 Form 组件,目前功能还比较基础,后续会持续完善
Most helpful comment
我用vee-validate来实现表单验证 可以与van-field组件无缝连接