fixed Form label bug, close 4289

This commit is contained in:
梁灏 2018-08-20 10:14:50 +08:00
parent 19a11e3b4f
commit e9f3d00f03

View file

@ -130,16 +130,18 @@
}, },
labelStyles () { labelStyles () {
let style = {}; let style = {};
const labelWidth = this.labelWidth || this.form.labelWidth; const labelWidth = this.labelWidth === 0 || this.labelWidth ? this.labelWidth : this.form.labelWidth;
if (labelWidth) {
if (labelWidth || labelWidth === 0) {
style.width = `${labelWidth}px`; style.width = `${labelWidth}px`;
} }
return style; return style;
}, },
contentStyles () { contentStyles () {
let style = {}; let style = {};
const labelWidth = this.labelWidth || this.form.labelWidth; const labelWidth = this.labelWidth === 0 || this.labelWidth ? this.labelWidth : this.form.labelWidth;
if (labelWidth) {
if (labelWidth || labelWidth === 0) {
style.marginLeft = `${labelWidth}px`; style.marginLeft = `${labelWidth}px`;
} }
return style; return style;