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 | 201 | return { |
202 | 202 | currentValue: this.value, |
203 | 203 | prefixCls: prefixCls, |
204 | - prepend: true, | |
205 | - append: true, | |
206 | 204 | slotReady: false, |
207 | 205 | textareaStyles: {}, |
208 | 206 | isOnComposition: false, |
... | ... | @@ -216,6 +214,16 @@ |
216 | 214 | if (type === 'password' && this.password && this.showPassword) type = 'text'; |
217 | 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 | 227 | showPrefix () { |
220 | 228 | let state = false; |
221 | 229 | if (this.type !== 'textarea') state = this.prefix !== '' || this.$slots.prefix !== undefined; |
... | ... | @@ -414,13 +422,6 @@ |
414 | 422 | } |
415 | 423 | }, |
416 | 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 | 425 | this.slotReady = true; |
425 | 426 | this.resizeTextarea(); |
426 | 427 | this.handleCalcIconOffset(); | ... | ... |