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"
|
class="el-form-item__label"
|
||||||
:style="labelStyle"
|
:style="labelStyle"
|
||||||
>
|
>
|
||||||
<slot name="label" :label="label + elForm.labelSuffix">
|
<slot name="label" :label="currentLabel">
|
||||||
{{ label + elForm.labelSuffix }}
|
{{ currentLabel }}
|
||||||
</slot>
|
</slot>
|
||||||
</label>
|
</label>
|
||||||
</LabelWrap>
|
</LabelWrap>
|
||||||
@ -345,6 +345,10 @@ export default defineComponent({
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const currentLabel = computed(
|
||||||
|
() => (props.label || '') + (elForm.labelSuffix || '')
|
||||||
|
)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
formItemRef,
|
formItemRef,
|
||||||
formItemClass,
|
formItemClass,
|
||||||
@ -356,6 +360,7 @@ export default defineComponent({
|
|||||||
labelFor,
|
labelFor,
|
||||||
resetField,
|
resetField,
|
||||||
clearValidate,
|
clearValidate,
|
||||||
|
currentLabel,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user