You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
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
I have searched the
issues
of this repository and believe that this is not a duplicate.
Version
1.3.8
Environment
chrome
Reproduction link
https://vue.ant.design/components/form-cn/
Steps to reproduce
const res = this . form . validateFields ( ( e ) => {
throw new Error ( 'abc' )
console . log ( 'then' )
} ) ;
What is expected?
浏览器会报错
What is actually happening?
首次提交表单会无反应,第二次会报错。
validateFieldsInternal函数首次执行的时候,fields字段的dirty都是undefined,进入到async-validator插件的asyncMap函数,这个函数不打印error。
pending.catch(e => e);
导致validateFields定义的pending这个promise一直处于pending状态。
希望在oldCb处加一个try catch,及时reject
callback = ( errors , values ) => {
if ( oldCb ) {
oldCb ( errors , values ) ;
} else if ( errors ) {
reject ( { errors, values } ) ;
} else {
resolve ( values ) ;
我也出现了无反应,结果是因为有 validator 自定义校验,注意了callback 一定要回调的问题,但没注意中间有错误,所以他reject 而没有catch 验证这里最好try 一下
请问你这个问题有解决吗?我也碰到了同样的问题。callback回调都加了