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() {
|
||||
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>
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user