fix(Field): should not get formValue from button slot (#5785)

This commit is contained in:
chenjiahan
2020-03-09 19:18:16 +08:00
parent ecce907de7
commit 09ad95ca68
2 changed files with 35 additions and 4 deletions
+12 -4
View File
@@ -125,7 +125,14 @@ export default createComponent({
},
formValue() {
return this.children ? this.children.value : this.value;
if (this.children && this.inputSlot) {
return this.children.value;
}
return this.value;
},
inputSlot() {
return this.slots('input');
},
},
@@ -374,12 +381,13 @@ export default createComponent({
genInput() {
const { type } = this;
const inputSlot = this.slots('input');
const inputAlign = this.getProp('inputAlign');
if (inputSlot) {
if (this.inputSlot) {
return (
<div class={bem('control', [inputAlign, 'custom'])}>{inputSlot}</div>
<div class={bem('control', [inputAlign, 'custom'])}>
{this.inputSlot}
</div>
);
}