From 28836d46265d2c4fd08db9151feb621079a75bf9 Mon Sep 17 00:00:00 2001 From: FEI <1556610925@qq.com> Date: Sun, 29 Jan 2023 15:39:48 +0800 Subject: [PATCH] append and prepend --- src/components/input/input.vue | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) 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