diff --git a/packages/form/src/label-wrap.vue b/packages/form/src/label-wrap.vue index 36d0d008f..9a844bc33 100644 --- a/packages/form/src/label-wrap.vue +++ b/packages/form/src/label-wrap.vue @@ -12,7 +12,12 @@ export default { const slots = this.$slots.default; if (!slots) return null; if (this.isAutoWidth) { - return (
+ const autoLabelWidth = this.elForm.autoLabelWidth; + const style = {}; + if (autoLabelWidth && autoLabelWidth !== 'auto') { + style.width = autoLabelWidth; + } + return (
{ slots }
); } else { diff --git a/packages/theme-chalk/src/form.scss b/packages/theme-chalk/src/form.scss index 802a1178e..3164a4a2b 100644 --- a/packages/theme-chalk/src/form.scss +++ b/packages/theme-chalk/src/form.scss @@ -86,6 +86,7 @@ @include e(label-wrap) { float: left; + text-align: right; .el-form-item__label { display: inline-block; float: none;