Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/docs/en-US/form.md
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ All components in a Form inherit their `size` attribute from that Form. Similarl
### Form Events
| Event Name | Description | Parameters |
|----------- |------------ |----------- |
| validate | triggers after a form item is validated | prop name of the form item being validated, whether validation is passed |
| validate | triggers after a form item is validated | prop name of the form item being validated, whether validation is passed and the error message if not |

### Form-Item Attributes

Expand Down
6 changes: 3 additions & 3 deletions examples/docs/es/form.md
Original file line number Diff line number Diff line change
Expand Up @@ -871,9 +871,9 @@ Todos los componentes de un formulario heredan su atributo `size`. De manera sim

### Form Events

| Nombre | Descripción | Parametros |
| -------- | ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| validate | se dispara después de validar un item del formulario | la propiedad (`prop name`) nombre del item del form que se esta validando, si la validacion paso o no. |
| Nombre | Descripción | Parametros |
| -------- | ---------------------------------------------------- | ------------------------------------------------------------ |
| validate | se dispara después de validar un item del formulario | la propiedad (`prop name`) nombre del item del form que se esta validando, si la validacion paso o no, mensaje de error si existe. |

### Form-Item Atributos

Expand Down
2 changes: 1 addition & 1 deletion examples/docs/zh-CN/form.md
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ W3C 标准中有如下[规定](https://www.w3.org/MarkUp/html-spec/html-spec_8.h
### Form Events
| 事件名称 | 说明 | 回调参数 |
|--------- |-------- |---------- |
| validate | 任一表单项被校验后触发 | 被校验的表单项 prop 值,校验是否通过 |
| validate | 任一表单项被校验后触发 | 被校验的表单项 prop 值,校验是否通过,错误消息(如果存在) |

### Form-Item Attributes

Expand Down
2 changes: 1 addition & 1 deletion packages/form/src/form-item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
this.validateMessage = errors ? errors[0].message : '';

callback(this.validateMessage, invalidFields);
this.elForm && this.elForm.$emit('validate', this.prop, !errors);
this.elForm && this.elForm.$emit('validate', this.prop, !errors, this.validateMessage || null);
});
},
clearValidate() {
Expand Down