mirror of https://github.com/ElemeFE/element
fix: Repair the alignment error problem when label-width is auto and label-position is left
parent
c345bb453b
commit
5e803ea66d
|
@ -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 (<div class="el-form-item__label-wrap" style={style}>
|
||||
|
|
Loading…
Reference in New Issue