mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(Field): should not cache input slot (#5868)
This commit is contained in:
parent
1aef6fd076
commit
f0a292134b
@ -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>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user