diff --git a/src/components/input/input.vue b/src/components/input/input.vue index 2d8498c..36456b0 100644 --- a/src/components/input/input.vue +++ b/src/components/input/input.vue @@ -201,6 +201,8 @@ return { currentValue: this.value, prefixCls: prefixCls, + prepend: true, + append: true, slotReady: false, textareaStyles: {}, isOnComposition: false, @@ -214,16 +216,6 @@ if (type === 'password' && this.password && this.showPassword) type = 'text'; return type; }, - prepend () { - let state = false; - if (this.type !== 'textarea') state = this.$slots.prepend !== undefined; - return state; - }, - append () { - let state = false; - if (this.type !== 'textarea') state = this.$slots.append !== undefined; - return state; - }, showPrefix () { let state = false; if (this.type !== 'textarea') state = this.prefix !== '' || this.$slots.prefix !== undefined; @@ -422,6 +414,13 @@ } }, mounted () { + if (this.type !== 'textarea') { + this.prepend = this.$slots.prepend !== undefined; + this.append = this.$slots.append !== undefined; + } else { + this.prepend = false; + this.append = false; + } this.slotReady = true; this.resizeTextarea(); this.handleCalcIconOffset(); -- libgit2 0.21.4