Redux Forms 中是否有办法通过代码验证表单? [英] Is there a way in Redux Forms to make a form validate from code?
本文介绍了Redux Forms 中是否有办法通过代码验证表单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当表单处于原始状态时,我无法在提交时验证我的代码.有没有办法让表单验证?
I'm having problems getting my code to validate on submit when the form is pristine. Is there a way to make the form validate?
推荐答案
试试下面的代码:
componentDidMount() {
this.props.touch('username', 'email', 'age') // pass names of input fields
}
这篇关于Redux Forms 中是否有办法通过代码验证表单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文