Skip to content

Commit 5e803ea

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

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/form/src/label-wrap.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ export default {
1717
if (autoLabelWidth && autoLabelWidth !== 'auto') {
1818
const marginLeft = parseInt(autoLabelWidth, 10) - this.computedWidth;
1919
if (marginLeft) {
20-
style.marginLeft = marginLeft + 'px';
20+
if(this.elForm.labelPosition === 'left'){
21+
style.marginRight = marginLeft + 'px';
22+
}else{
23+
style.marginLeft = marginLeft + 'px';
24+
}
2125
}
2226
}
2327
return (<div class="el-form-item__label-wrap" style={style}>

0 commit comments

Comments
 (0)