Commit f4e462c05176512ab40d802026695ec474e18c99

Authored by 梁灏
1 parent 319f5f86

#554

examples/routers/input.vue
1 1 <template>
2 2 <div style="width: 300px;">
  3 + <i-input v-model="value11">
  4 + </i-input>
  5 + <i-input v-model="value11" icon="ios-clock-outline">
  6 + <span slot="prepend">.com</span>
  7 + </i-input>
3 8 <i-input v-model="value11" icon="ios-clock-outline">
4   - <span slot="prepend">http://</span>
  9 + <span slot="append">.com</span>
5 10 </i-input>
6 11 </div>
7 12 </template>
... ...
src/components/input/input.vue
... ... @@ -118,7 +118,8 @@
118 118 [`${prefixCls}-wrapper-${this.size}`]: !!this.size,
119 119 [`${prefixCls}-type`]: this.type,
120 120 [`${prefixCls}-group`]: this.prepend || this.append,
121   - [`${prefixCls}-group-${this.size}`]: (this.prepend || this.append) && !!this.size
  121 + [`${prefixCls}-group-${this.size}`]: (this.prepend || this.append) && !!this.size,
  122 + [`${prefixCls}-hide-icon`]: this.append // #554
122 123 }
123 124 ];
124 125 },
... ...
src/styles/components/input.less
... ... @@ -19,6 +19,9 @@
19 19 right: 0;
20 20 z-index: 3;
21 21 }
  22 + &-hide-icon &-icon{
  23 + display: none;
  24 + }
22 25 &-icon-validate{
23 26 display: none;
24 27 }
... ... @@ -26,6 +29,10 @@
26 29 &-icon-normal + &{
27 30 padding-right: 32px;
28 31 }
  32 + // #554
  33 + &-hide-icon &-icon-normal + &{
  34 + padding-right: @input-padding-horizontal;
  35 + }
29 36  
30 37 &-wrapper-large &-icon{
31 38 font-size: 18px;
... ...