Skip to content

Commit 543a718

Browse files
committed
fix: Repair the alignment error problem when label-width is auto and label-position is left
1 parent c345bb4 commit 543a718

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/form/src/label-wrap.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default {
1717
if (autoLabelWidth && autoLabelWidth !== 'auto') {
1818
const marginLeft = parseInt(autoLabelWidth, 10) - this.computedWidth;
1919
if (marginLeft) {
20-
style.marginLeft = marginLeft + 'px';
20+
style[(this.elForm.labelPosition === 'left') ? 'marginRight' : 'marginLeft'] = marginLeft + 'px';
2121
}
2222
}
2323
return (<div class="el-form-item__label-wrap" style={style}>

0 commit comments

Comments
 (0)