From ad1301636d563a237336128ab3a57a9464322538 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Mon, 17 Aug 2020 20:06:39 +0800 Subject: [PATCH] fix(Field): failed to inherit class/style --- src/field/index.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/field/index.js b/src/field/index.js index 8d02b8fd0..dadc9c68a 100644 --- a/src/field/index.js +++ b/src/field/index.js @@ -429,6 +429,7 @@ export default createComponent({ ...this.$attrs, ref: 'input', name: this.name, + style: null, class: bem('control', inputAlign), value: this.modelValue, disabled: this.disabled, @@ -569,12 +570,16 @@ export default createComponent({ }} icon={this.leftIcon} size={this.size} - class={bem({ - error: this.showError, - disabled: this.disabled, - [`label-${labelAlign}`]: labelAlign, - 'min-height': this.type === 'textarea' && !this.autosize, - })} + class={[ + bem({ + error: this.showError, + disabled: this.disabled, + [`label-${labelAlign}`]: labelAlign, + 'min-height': this.type === 'textarea' && !this.autosize, + }), + this.$attrs.class, + ]} + style={this.$attrs.style} center={this.center} border={this.border} isLink={this.isLink}