Skip to content

可否支持设置Form全局校验触发时机 #1635

Answered by janryWang
li9269391 asked this question in Q&A [2.x]
Discussion options

You must be logged in to vote

教你个高级写法

effects:()=>{
  onFieldInit('*',field=>{
      if(Array.isArray(field.validator)){
          field.validator.forEach((item)=>{
             item.triggerType = 'onBlur'
           })
      } else if(typeof validator === 'object') {
       field.validator.triggerType = 'onBlur'
      
  })
}

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
6 replies
@li9269391
Comment options

@janryWang
Comment options

@li9269391
Comment options

@janryWang
Comment options

@li9269391
Comment options

Comment options

You must be logged in to vote
1 reply
@li9269391
Comment options

Answer selected by li9269391
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants