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}
); }