Commit 901ff0ed authored by hetech's avatar hetech Committed by GitHub

Form: fix style when label-width is auto (#14955)

parent 30551c0e
...@@ -12,7 +12,12 @@ export default { ...@@ -12,7 +12,12 @@ export default {
const slots = this.$slots.default; const slots = this.$slots.default;
if (!slots) return null; if (!slots) return null;
if (this.isAutoWidth) { if (this.isAutoWidth) {
return (<div class="el-form-item__label-wrap"> const autoLabelWidth = this.elForm.autoLabelWidth;
const style = {};
if (autoLabelWidth && autoLabelWidth !== 'auto') {
style.width = autoLabelWidth;
}
return (<div class="el-form-item__label-wrap" style={style}>
{ slots } { slots }
</div>); </div>);
} else { } else {
......
...@@ -86,6 +86,7 @@ ...@@ -86,6 +86,7 @@
@include e(label-wrap) { @include e(label-wrap) {
float: left; float: left;
text-align: right;
.el-form-item__label { .el-form-item__label {
display: inline-block; display: inline-block;
float: none; float: none;
......
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