element form validation writing optional data

Is not required but you need to verify, because there is no input, form submission is unsuccessful at the time of submission of the form. 

 

= validateTelphone the let (rule, value, the callback) => {
       IF (value) {
         IF (/ ^ (\ (\ D {3,4-} \) | \ D {3,4-} - |! \ D {. 3, }. 4 - \ D {3,4-} - |?. \ S) \ {D} $ 4,14 / Test (value) || value == '' ) { 
          the callback ( new new Error ( 'Please input the correct company phone ' )); 
        } the else { 
          the callback (); 
        } 
      } the else { 
        the callback (); 
      } 
    };

Forms Authentication writing:

'contactInfo.telphone': [{ required: false, validator: validateTelphone, trigger: 'blur' }]

  

Guess you like

Origin www.cnblogs.com/wszxx/p/10950070.html