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

pull/14963/head
hetech 2019-04-03 16:49:27 +08:00 committed by GitHub
parent 30551c0e18
commit 901ff0ed2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -12,7 +12,12 @@ export default {
const slots = this.$slots.default;
if (!slots) return null;
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 }
</div>);
} else {

View File

@ -86,6 +86,7 @@
@include e(label-wrap) {
float: left;
text-align: right;
.el-form-item__label {
display: inline-block;
float: none;