Skip to content

Commit

Permalink
docs(examples): delete form validate return and perfect types (#16778)
Browse files Browse the repository at this point in the history
* docs: delete form exampls validate return value

* docs: delete form exampls validate return value

* update form.md

* docs: delete form validate return
  • Loading branch information
warmthsea committed May 12, 2024
1 parent 43c8f35 commit 052af0c
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/en-US/component/form.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ type FormValidationResult = Promise<boolean>
type FormValidateCallback = (
isValid: boolean,
invalidFields?: ValidateFieldsError
) => void
) => Promise<void> | void

// RuleItem: see [async-validator](https://github.com/yiminghe/async-validator/blob/master/src/interface.ts)
interface FormItemRule extends RuleItem {
Expand Down
3 changes: 1 addition & 2 deletions docs/examples/form/custom-validation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const validatePass = (rule: any, value: any, callback: any) => {
} else {
if (ruleForm.checkPass !== '') {
if (!ruleFormRef.value) return
ruleFormRef.value.validateField('checkPass', () => null)
ruleFormRef.value.validateField('checkPass')
}
callback()
}
Expand Down Expand Up @@ -93,7 +93,6 @@ const submitForm = (formEl: FormInstance | undefined) => {
console.log('submit!')
} else {
console.log('error submit!')
return false
}
})
}
Expand Down
1 change: 0 additions & 1 deletion docs/examples/form/form-items.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ const submitForm = (formEl: FormInstance | undefined) => {
console.log('submit!')
} else {
console.log('error submit!')
return false
}
})
}
Expand Down
1 change: 0 additions & 1 deletion docs/examples/form/number-validate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ const submitForm = (formEl: FormInstance | undefined) => {
console.log('submit!')
} else {
console.log('error submit!')
return false
}
})
}
Expand Down

0 comments on commit 052af0c

Please sign in to comment.