fix(Field): should not cache input slot (#5868)

This commit is contained in:
chenjiahan 2020-03-20 14:35:52 +08:00
parent 1aef6fd076
commit f0a292134b

View File

@ -124,15 +124,11 @@ export default createComponent({
},
formValue() {
if (this.children && this.inputSlot) {
if (this.children && (this.$scopedSlots.input || this.$slots.input)) {
return this.children.value;
}
return this.value;
},
inputSlot() {
return this.slots('input');
},
},
methods: {
@ -380,13 +376,12 @@ export default createComponent({
genInput() {
const { type } = this;
const inputSlot = this.slots('input');
const inputAlign = this.getProp('inputAlign');
if (this.inputSlot) {
if (inputSlot) {
return (
<div class={bem('control', [inputAlign, 'custom'])}>
{this.inputSlot}
</div>
<div class={bem('control', [inputAlign, 'custom'])}>{inputSlot}</div>
);
}