mirror of https://github.com/ElemeFE/element
Form: Add label slot
parent
6ee73f7715
commit
bf7eabb64d
|
@ -765,3 +765,10 @@ Form component allows you to verify your data, helping you find and correct erro
|
|||
| rules | validation rules of form | object | — | — |
|
||||
| error | field error message, set its value and the field will validate error and show this message immediately | string | — | — |
|
||||
| show-message | whether to show the error message | boolean | — | true |
|
||||
|
||||
|
||||
### Form-Item Slot
|
||||
| name | Description |
|
||||
|------|--------|
|
||||
| — | content of Form Item |
|
||||
| label | content of label |
|
||||
|
|
|
@ -753,3 +753,9 @@
|
|||
| rules | 表单验证规则 | object | — | — |
|
||||
| error | 表单域验证错误信息, 设置该值会使表单验证状态变为`error`,并显示该错误信息 | string | — | — |
|
||||
| show-message | 是否显示校验错误信息 | boolean | — | true |
|
||||
|
||||
### Form-Item Slot
|
||||
| name | 说明 |
|
||||
|------|--------|
|
||||
| — | Form Item 的内容 |
|
||||
| label | 标签文本的内容 |
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
'is-required': isRequired || required
|
||||
}">
|
||||
<label :for="prop" class="el-form-item__label" v-bind:style="labelStyle" v-if="label">
|
||||
{{label + form.labelSuffix}}
|
||||
<slot name="label">{{label + form.labelSuffix}}</slot>
|
||||
</label>
|
||||
<div class="el-form-item__content" v-bind:style="contentStyle">
|
||||
<slot></slot>
|
||||
|
|
Loading…
Reference in New Issue