Commit 20766f287022ab441fc9d7e9d3abd52f65c8b44a
1 parent
c3a9f389
update Input
update Input
Showing
3 changed files
with
12 additions
and
1 deletions
Show diff stats
src/components/input/input.vue
@@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
3 | <template v-if="type !== 'textarea'"> | 3 | <template v-if="type !== 'textarea'"> |
4 | <div :class="[prefixCls + '-group-prepend']" v-if="prepend" v-show="slotReady" v-el:prepend><slot name="prepend"></slot></div> | 4 | <div :class="[prefixCls + '-group-prepend']" v-if="prepend" v-show="slotReady" v-el:prepend><slot name="prepend"></slot></div> |
5 | <i class="ivu-icon" :class="['ivu-icon-' + icon, prefixCls + '-icon']" v-if="icon" @click="handleIconClick"></i> | 5 | <i class="ivu-icon" :class="['ivu-icon-' + icon, prefixCls + '-icon']" v-if="icon" @click="handleIconClick"></i> |
6 | + <i class="ivu-icon ivu-icon-load-c ivu-load-loop" :class="[prefixCls + '-icon', prefixCls + '-icon-validate']" v-else transition="fade"></i> | ||
6 | <input | 7 | <input |
7 | :type="type" | 8 | :type="type" |
8 | :class="inputClasses" | 9 | :class="inputClasses" |
src/styles/components/input.less
@@ -19,6 +19,9 @@ | @@ -19,6 +19,9 @@ | ||
19 | right: 0; | 19 | right: 0; |
20 | z-index: 1; | 20 | z-index: 1; |
21 | } | 21 | } |
22 | + &-icon-validate{ | ||
23 | + display: none; | ||
24 | + } | ||
22 | 25 | ||
23 | &-icon + &{ | 26 | &-icon + &{ |
24 | padding-right: 32px; | 27 | padding-right: 32px; |
@@ -55,4 +58,11 @@ | @@ -55,4 +58,11 @@ | ||
55 | .@{input-prefix-cls}-group{ | 58 | .@{input-prefix-cls}-group{ |
56 | .input-group-error; | 59 | .input-group-error; |
57 | } | 60 | } |
61 | +} | ||
62 | +.@{form-item-prefix-cls}-validating{ | ||
63 | + .@{input-prefix-cls}{ | ||
64 | + &-icon-validate{ | ||
65 | + display: inline-block; | ||
66 | + } | ||
67 | + } | ||
58 | } | 68 | } |
59 | \ No newline at end of file | 69 | \ No newline at end of file |
test/routers/form.vue
@@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
8 | <i-input type="password" :value.sync="formCustom.passwdCheck"></i-input> | 8 | <i-input type="password" :value.sync="formCustom.passwdCheck"></i-input> |
9 | </Form-item> | 9 | </Form-item> |
10 | <Form-item label="年龄" prop="age"> | 10 | <Form-item label="年龄" prop="age"> |
11 | - <i-input type="text" :value.sync="formCustom.age"></i-input> | 11 | + <i-input type="text" :value.sync="formCustom.age" number></i-input> |
12 | </Form-item> | 12 | </Form-item> |
13 | <Form-item> | 13 | <Form-item> |
14 | <i-button type="primary" @click="handleSubmit('formCustom')">提交</i-button> | 14 | <i-button type="primary" @click="handleSubmit('formCustom')">提交</i-button> |