mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-04 04:08:34 +08:00
fix(components): [ElFormItem] label will be show undefined (#4487)
This commit is contained in:
parent
0832a55f89
commit
8fe4f1e65e
@ -10,8 +10,8 @@
|
||||
class="el-form-item__label"
|
||||
:style="labelStyle"
|
||||
>
|
||||
<slot name="label" :label="label + elForm.labelSuffix">
|
||||
{{ label + elForm.labelSuffix }}
|
||||
<slot name="label" :label="currentLabel">
|
||||
{{ currentLabel }}
|
||||
</slot>
|
||||
</label>
|
||||
</LabelWrap>
|
||||
@ -345,6 +345,10 @@ export default defineComponent({
|
||||
)
|
||||
})
|
||||
|
||||
const currentLabel = computed(
|
||||
() => (props.label || '') + (elForm.labelSuffix || '')
|
||||
)
|
||||
|
||||
return {
|
||||
formItemRef,
|
||||
formItemClass,
|
||||
@ -356,6 +360,7 @@ export default defineComponent({
|
||||
labelFor,
|
||||
resetField,
|
||||
clearValidate,
|
||||
currentLabel,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user