fix(Field): should not cache input slot (#5868)
This commit is contained in:
+4
-9
@@ -124,15 +124,11 @@ export default createComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
formValue() {
|
formValue() {
|
||||||
if (this.children && this.inputSlot) {
|
if (this.children && (this.$scopedSlots.input || this.$slots.input)) {
|
||||||
return this.children.value;
|
return this.children.value;
|
||||||
}
|
}
|
||||||
return this.value;
|
return this.value;
|
||||||
},
|
},
|
||||||
|
|
||||||
inputSlot() {
|
|
||||||
return this.slots('input');
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@@ -380,13 +376,12 @@ export default createComponent({
|
|||||||
|
|
||||||
genInput() {
|
genInput() {
|
||||||
const { type } = this;
|
const { type } = this;
|
||||||
|
const inputSlot = this.slots('input');
|
||||||
const inputAlign = this.getProp('inputAlign');
|
const inputAlign = this.getProp('inputAlign');
|
||||||
|
|
||||||
if (this.inputSlot) {
|
if (inputSlot) {
|
||||||
return (
|
return (
|
||||||
<div class={bem('control', [inputAlign, 'custom'])}>
|
<div class={bem('control', [inputAlign, 'custom'])}>{inputSlot}</div>
|
||||||
{this.inputSlot}
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user