From f0a292134bac2256245e7ec302fe8cfa2d20a957 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Fri, 20 Mar 2020 14:35:52 +0800 Subject: [PATCH] fix(Field): should not cache input slot (#5868) --- src/field/index.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/field/index.js b/src/field/index.js index 12c37c6d7..ae8e5cb6d 100644 --- a/src/field/index.js +++ b/src/field/index.js @@ -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 ( -
- {this.inputSlot} -
+
{inputSlot}
); }