Skip to content

Commit

Permalink
fix(components): [ElFormItem] label will be show undefined (element-p…
Browse files Browse the repository at this point in the history
  • Loading branch information
emojiiii committed Nov 22, 2021
1 parent 0832a55 commit 8fe4f1e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/components/form/src/form-item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -345,6 +345,10 @@ export default defineComponent({
)
})
const currentLabel = computed(
() => (props.label || '') + (elForm.labelSuffix || '')
)
return {
formItemRef,
formItemClass,
Expand All @@ -356,6 +360,7 @@ export default defineComponent({
labelFor,
resetField,
clearValidate,
currentLabel,
}
},
})
Expand Down

0 comments on commit 8fe4f1e

Please sign in to comment.