@@ -694,11 +662,8 @@ Form component allows you to verify your data, helping you find and correct erro
};
},
methods:{
handleReset2(){
this.$refs.ruleForm2.resetFields();
},
handleSubmit2(ev){
this.$refs.ruleForm2.validate((valid)=>{
submitForm(formName){
this.$refs[formName].validate((valid)=>{
if(valid){
alert('submit!');
}else{
...
...
@@ -706,6 +671,9 @@ Form component allows you to verify your data, helping you find and correct erro
returnfalse;
}
});
},
resetForm(formName){
this.$refs[formName].resetFields();
}
}
}
...
...
@@ -718,12 +686,19 @@ Form component allows you to verify your data, helping you find and correct erro
:::demo In addition to passing all validation rules at once on the form component, you can also pass the validation rules or delete rules on a single form field dynamically.
@@ -788,7 +757,56 @@ Form component allows you to verify your data, helping you find and correct erro
}
</script>
```
:::
:::
### Number Validate
::: demo Number Validate need a `.number` modifier added on the input `v-model` binding,it's used to transform the string value to the number which is provided by Vuejs.