From 5e803ea66dcced797df6b0c58e7de17bf8b2e847 Mon Sep 17 00:00:00 2001 From: wxwzl Date: Fri, 13 Sep 2024 11:29:16 +0800 Subject: [PATCH] fix: Repair the alignment error problem when label-width is auto and label-position is left --- packages/form/src/label-wrap.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/form/src/label-wrap.vue b/packages/form/src/label-wrap.vue index d263f7ddc..195725d88 100644 --- a/packages/form/src/label-wrap.vue +++ b/packages/form/src/label-wrap.vue @@ -17,7 +17,11 @@ export default { if (autoLabelWidth && autoLabelWidth !== 'auto') { const marginLeft = parseInt(autoLabelWidth, 10) - this.computedWidth; if (marginLeft) { - style.marginLeft = marginLeft + 'px'; + if(this.elForm.labelPosition === 'left'){ + style.marginRight = marginLeft + 'px'; + }else{ + style.marginLeft = marginLeft + 'px'; + } } } return (