Commit bf7eabb6 authored by Liril's avatar Liril Committed by 杨奕

Form: Add label slot

parent 6ee73f77
...@@ -765,3 +765,10 @@ Form component allows you to verify your data, helping you find and correct erro ...@@ -765,3 +765,10 @@ Form component allows you to verify your data, helping you find and correct erro
| rules | validation rules of form | object | — | — | | 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 | — | — | | 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 | | 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 @@ ...@@ -753,3 +753,9 @@
| rules | 表单验证规则 | object | — | — | | rules | 表单验证规则 | object | — | — |
| error | 表单域验证错误信息, 设置该值会使表单验证状态变为`error`,并显示该错误信息 | string | — | — | | error | 表单域验证错误信息, 设置该值会使表单验证状态变为`error`,并显示该错误信息 | string | — | — |
| show-message | 是否显示校验错误信息 | boolean | — | true | | show-message | 是否显示校验错误信息 | boolean | — | true |
### Form-Item Slot
| name | 说明 |
|------|--------|
| — | Form Item 的内容 |
| label | 标签文本的内容 |
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
'is-required': isRequired || required 'is-required': isRequired || required
}"> }">
<label :for="prop" class="el-form-item__label" v-bind:style="labelStyle" v-if="label"> <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> </label>
<div class="el-form-item__content" v-bind:style="contentStyle"> <div class="el-form-item__content" v-bind:style="contentStyle">
<slot></slot> <slot></slot>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment