Commit f29a59f58c2c5bd4f1149fbedcf1a0ec191050bb
1 parent
28836d46
cancel
Showing
1 changed file
with
10 additions
and
9 deletions
Show diff stats
src/components/input/input.vue
@@ -201,8 +201,6 @@ | @@ -201,8 +201,6 @@ | ||
201 | return { | 201 | return { |
202 | currentValue: this.value, | 202 | currentValue: this.value, |
203 | prefixCls: prefixCls, | 203 | prefixCls: prefixCls, |
204 | - prepend: true, | ||
205 | - append: true, | ||
206 | slotReady: false, | 204 | slotReady: false, |
207 | textareaStyles: {}, | 205 | textareaStyles: {}, |
208 | isOnComposition: false, | 206 | isOnComposition: false, |
@@ -216,6 +214,16 @@ | @@ -216,6 +214,16 @@ | ||
216 | if (type === 'password' && this.password && this.showPassword) type = 'text'; | 214 | if (type === 'password' && this.password && this.showPassword) type = 'text'; |
217 | return type; | 215 | return type; |
218 | }, | 216 | }, |
217 | + prepend () { | ||
218 | + let state = false; | ||
219 | + if (this.type !== 'textarea') state = this.$slots.prepend !== undefined; | ||
220 | + return state; | ||
221 | + }, | ||
222 | + append () { | ||
223 | + let state = false; | ||
224 | + if (this.type !== 'textarea') state = this.$slots.append !== undefined; | ||
225 | + return state; | ||
226 | + }, | ||
219 | showPrefix () { | 227 | showPrefix () { |
220 | let state = false; | 228 | let state = false; |
221 | if (this.type !== 'textarea') state = this.prefix !== '' || this.$slots.prefix !== undefined; | 229 | if (this.type !== 'textarea') state = this.prefix !== '' || this.$slots.prefix !== undefined; |
@@ -414,13 +422,6 @@ | @@ -414,13 +422,6 @@ | ||
414 | } | 422 | } |
415 | }, | 423 | }, |
416 | mounted () { | 424 | mounted () { |
417 | - if (this.type !== 'textarea') { | ||
418 | - this.prepend = this.$slots.prepend !== undefined; | ||
419 | - this.append = this.$slots.append !== undefined; | ||
420 | - } else { | ||
421 | - this.prepend = false; | ||
422 | - this.append = false; | ||
423 | - } | ||
424 | this.slotReady = true; | 425 | this.slotReady = true; |
425 | this.resizeTextarea(); | 426 | this.resizeTextarea(); |
426 | this.handleCalcIconOffset(); | 427 | this.handleCalcIconOffset(); |