diff --git a/examples/docs/en-US/form.md b/examples/docs/en-US/form.md index b9977af45..2eb1b4153 100644 --- a/examples/docs/en-US/form.md +++ b/examples/docs/en-US/form.md @@ -47,6 +47,16 @@ resource: '', desc: '' }, + sizeForm: { + name: '', + region: '', + date1: '', + date2: '', + delivery: false, + type: [], + resource: '', + desc: '' + }, formInline: { user: '', region: '' @@ -745,33 +755,33 @@ All components in a Form inherit their `size` attribute from that Form. Similarl ::: demo Still you can fine tune each component's `size` if you don't want that component to inherit its size from From or FormIten. ```html - + - + - + - + - - + - + - + @@ -781,6 +791,30 @@ All components in a Form inherit their `size` attribute from that Form. Similarl Cancel + + ``` ::: @@ -806,6 +840,7 @@ All components in a Form inherit their `size` attribute from that Form. Similarl | validate | the method to validate the whole form. Returns a promise if callback is omitted | Function(callback: Function(boolean)) | | validateField | the method to validate a certain form item | Function(prop: string, callback: Function(errorMessage: string)) | | resetFields | reset all the fields and remove validation result | — | +| clearValidate | clear validation message for all fields | - ### Form-Item Attributes diff --git a/examples/docs/zh-CN/form.md b/examples/docs/zh-CN/form.md index 998dc70cb..0f540eb99 100644 --- a/examples/docs/zh-CN/form.md +++ b/examples/docs/zh-CN/form.md @@ -47,6 +47,16 @@ resource: '', desc: '' }, + sizeForm: { + name: '', + region: '', + date1: '', + date2: '', + delivery: false, + type: [], + resource: '', + desc: '' + }, formInline: { user: '', region: '' @@ -734,34 +744,34 @@ ::: demo 如果希望某个表单项或某个表单组件的尺寸不同于 Form 上的`size`属性,直接为这个表单项或表单组件设置自己的`size`即可。 ```html - + - + - + - + - - + - + - + @@ -771,6 +781,30 @@ 取消 + + ``` ::: @@ -796,6 +830,7 @@ | validate | 对整个表单进行校验的方法。若不传入回调函数,则会返回一个 promise | Function(callback: Function(boolean)) | validateField | 对部分表单字段进行校验的方法 | Function(prop: string, callback: Function(errorMessage: string)) | resetFields | 对整个表单进行重置,将所有字段值重置为初始值并移除校验结果 | - +| clearValidate | 移除整个表单的校验结果 | - ### Form-Item Attributes diff --git a/packages/form/src/form-item.vue b/packages/form/src/form-item.vue index 9d1331d27..2e7a21d84 100644 --- a/packages/form/src/form-item.vue +++ b/packages/form/src/form-item.vue @@ -8,7 +8,7 @@ }, sizeClass ? 'el-form-item--' + sizeClass : '' ]"> -