diff --git a/examples/docs/en-US/form.md b/examples/docs/en-US/form.md index 248a3881e..bc47b1d3e 100644 --- a/examples/docs/en-US/form.md +++ b/examples/docs/en-US/form.md @@ -51,18 +51,8 @@ user: '', region: '' }, - formStacked: { - name: '', - region: '', - type: '', - remark: '' - }, - formAlignRight: { - name: '', - region: '', - type: '' - }, - formAlignLeft: { + labelPosition: 'right', + formLabelAlign: { name: '', region: '', type: '' @@ -221,13 +211,6 @@ margin-right: 10px; } } - .demo-form-stacked { - width: 270px; - - .el-select .el-input { - width: 100%; - } - } .demo-ruleForm { width: 480px; @@ -372,27 +355,32 @@ When the vertical space is limited and the form is relatively simple, you can pu Depending on your design, there are several different ways to align your label element. -#### Top - :::demo The `label-position` attribute decides how labels align, it can be `top` or `left`. When set to `top`, labels will be placed at the top of the form field. ```html - + + Left + Right + Top + +
+ - + - + - + -``` -::: - -#### Left - -:::demo When `label-position` is set to `top`, labels will align to the left. - -```html - - - - - - - - - - - - -``` - -::: - ### Validation Form component allows you to verify your data, helping you find and correct errors. diff --git a/examples/docs/zh-CN/form.md b/examples/docs/zh-CN/form.md index aade65ff8..45f2b3e87 100644 --- a/examples/docs/zh-CN/form.md +++ b/examples/docs/zh-CN/form.md @@ -51,18 +51,8 @@ user: '', region: '' }, - formStacked: { - name: '', - region: '', - type: '', - remark: '' - }, - formAlignRight: { - name: '', - region: '', - type: '' - }, - formAlignLeft: { + labelPosition: 'right', + formLabelAlign: { name: '', region: '', type: '' @@ -216,13 +206,6 @@ margin-right: 10px; } } - .demo-form-stacked { - width: 270px; - - .el-select .el-input { - width: 100%; - } - } .demo-ruleForm { width: 460px; @@ -365,88 +348,31 @@ 根据具体目标和制约因素,选择最佳的标签对齐方式。 -顶部对齐 - ::: demo 通过设置 `label-position` 属性可以改变表单域标签的位置,可选值为 `top`、`left`,当设为 `top` 时标签会置于表单域的顶部 ```html - + + 左对齐 + 右对齐 + 顶部对齐 + +
+ - + - - - - - - - -``` -::: - -右对齐 - -::: demo 通过设置 `label-position` 属性可以改变表单域标签的位置,默认不设置的情况下标签是右对齐的 -```html - - - - - - + - + -``` -::: - -左对齐 - -::: demo 通过设置 `label-position` 属性可以改变表单域标签的位置,可选值为 `top`、`left`,当设为 `left` 时标签会变为左对齐 -```html - - - - - - - - - - - -