feat(Field): add message param to 'end-validate' method (#11080)

This commit is contained in:
Gavin 2022-09-24 10:44:48 +08:00 committed by GitHub
parent 0ceb6a843c
commit ece27f9474
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

View File

@ -231,7 +231,11 @@ export default defineComponent({
state.validateMessage = '';
};
const endValidate = () => emit('endValidate', { status: state.status });
const endValidate = () =>
emit('endValidate', {
status: state.status,
message: state.validateMessage,
});
const validate = (rules = props.rules) =>
new Promise<FieldValidateError | void>((resolve) => {

View File

@ -299,7 +299,7 @@ Use `input-align` prop to align the input value.
| click-left-icon | Emitted when the left icon is clicked | _event: MouseEvent_ |
| click-right-icon | Emitted when the right icon is clicked | _event: MouseEvent_ |
| start-validate `v3.5.1` | Emitted when start validation | - |
| end-validate `v3.5.1` | Emitted when end validation | _{ status: string }_ |
| end-validate `v3.5.1` | Emitted when end validation | _{ status: string, message: string }_ |
### Methods

View File

@ -318,7 +318,7 @@ export default {
| click-left-icon | 点击左侧图标时触发 | _event: MouseEvent_ |
| click-right-icon | 点击右侧图标时触发 | _event: MouseEvent_ |
| start-validate `v3.5.1` | 开始表单校验时触发 | - |
| end-validate `v3.5.1` | 结束表单校验时触发 | _{ status: string }_ |
| end-validate `v3.5.1` | 结束表单校验时触发 | _{ status: string, message: string }_ |
### 方法