Эх сурвалжийг харах

docs: improved documentation for el-form (#12635)

* Docs: Document el-form label-position attribute

Adds improved documentation to the el-form `label-position` attribute, which behaves differently when used with and without `label-width`. This has been a source of confusion for myself and others:

https://github.com/ElemeFE/element/issues/8477

Thanks!

* Document el-form label-position attribute (zh-CN, needs translation)

* Document el-form label-position attribute (es)

* Update form.md
Kaveet Laxmidas 6 жил өмнө
parent
commit
0bc07d7ec4

+ 1 - 1
examples/docs/en-US/form.md

@@ -835,7 +835,7 @@ All components in a Form inherit their `size` attribute from that Form. Similarl
 | model| data of form component | object | — | — |
 | rules | validation rules of form | object | — | — |
 | inline | whether the form is inline | boolean | — | false |
-| label-position | position of label | string | left / right / top | right |
+| label-position | position of label. If set to 'left' or 'right', `label-width` prop is also required | string | left / right / top | right |
 | label-width | width of label, and all its direct child form items will inherit this value | string | — | — |
 | label-suffix | suffix of the label | string | — | — |
 | show-message  | whether to show the error message | boolean | — | true |

+ 1 - 1
examples/docs/es/form.md

@@ -840,7 +840,7 @@ Todos los componentes de un formulario heredan su atributo `size`. De manera sim
 | model                   | Datos del componente                     | object  | —                     | —           |
 | rules                   | Reglas de validación                     | object  | —                     | —           |
 | inline                  | Si el form es inline                     | boolean | —                     | false       |
-| label-position          | Posicion de la etiqueta                  | string  | left / right / top    | right       |
+| label-position          | Posicion de la etiqueta. Si esta 'left' o 'right', también se necesita el prop `label-width`                  | string  | left / right / top    | right       |
 | label-width             | ancho de la etiqueta, y todos los form items directos descendientes heredarán este valor | string  | —                     | —           |
 | label-suffix            | sufijo de la etiqueta                    | string  | —                     | —           |
 | show-message            | si mostrar o no el mensaje de error      | boolean | —                     | true        |

+ 1 - 1
examples/docs/zh-CN/form.md

@@ -823,7 +823,7 @@ W3C 标准中有如下[规定](https://www.w3.org/MarkUp/html-spec/html-spec_8.h
 | model   | 表单数据对象 | object      |                  —                |  — |
 | rules    | 表单验证规则 | object | — | — |
 | inline    | 行内表单模式 | boolean | — | false |
-| label-position | 表单域标签的位置 | string |  right/left/top            | right |
+| label-position | 表单域标签的位置,如果值为 left 或者 right 时,则需要设置 `label-width` | string |  right/left/top            | right |
 | label-width | 表单域标签的宽度,作为 Form 直接子元素的 form-item 会继承该值 | string | — | — |
 | label-suffix | 表单域标签的后缀 | string | — | — |
 | show-message  | 是否显示校验错误信息 | boolean | — | true |