Commit 9f45c24f2ed9239f0f9bb35344e06465ab0d388b

Authored by 梁灏
1 parent 325243d3

change sync to loading

examples/routers/input.vue
@@ -14,7 +14,17 @@ @@ -14,7 +14,17 @@
14 <Button type="ghost" @click="handleReset('formCustom')" style="margin-left: 8px">Reset</Button> 14 <Button type="ghost" @click="handleReset('formCustom')" style="margin-left: 8px">Reset</Button>
15 </FormItem> 15 </FormItem>
16 <br><br> 16 <br><br>
  17 + <Icon class="ivu-load-loop" type="loading" size="14" color="#ff6600" />
  18 +
  19 + <Icon class="ivu-load-loop" type="loading" size="12" color="#ff6600" />
  20 + <Icon class="ivu-load-loop" type="loading" size="13" color="#ff6600" />
  21 +
  22 + <Icon class="ivu-load-loop" type="loading" size="16" color="#ff6600" />
  23 + <Icon class="ivu-load-loop" type="loading" size="18" color="#ff6600" />
  24 + <Icon class="ivu-load-loop" type="loading" size="20" color="#ff6600" />
17 <Icon class="ivu-load-loop" type="loading" size="30" color="#ff6600" /> 25 <Icon class="ivu-load-loop" type="loading" size="30" color="#ff6600" />
  26 + <Icon class="ivu-load-loop" type="loading" size="30" color="#ff6600" />
  27 +
18 <Icon type="ios-alert" size="30" color="#ff6600" /> 28 <Icon type="ios-alert" size="30" color="#ff6600" />
19 <Icon class="ivu-load-loop" type="ios-sync" size="30" color="#ff6600" /> 29 <Icon class="ivu-load-loop" type="ios-sync" size="30" color="#ff6600" />
20 </Form> 30 </Form>
examples/routers/message.vue
1 <template> 1 <template>
2 - <div>  
3 - <i-button @click.native="info">显示普通提示</i-button>  
4 - <i-button @click.native="success">显示成功提示</i-button>  
5 - <i-button @click.native="warning">显示警告提示</i-button>  
6 - <i-button @click.native="error">显示错误提示</i-button>  
7 - <i-button @click.native="destroy">销毁提示</i-button>  
8 - </div> 2 + <Button @click="loading">Display loading...</Button>
9 </template> 3 </template>
10 <script> 4 <script>
11 export default { 5 export default {
12 methods: { 6 methods: {
13 - info () {  
14 -// this.$Message.info('这是一条普通提示');  
15 - this.$Message.success({  
16 - content: '这是一条普通提示2',  
17 - duration: 500,  
18 - onClose () {  
19 -// console.log(123)  
20 - },  
21 - closable: true,  
22 - render (h) {  
23 - return h('Button',{  
24 - props: {  
25 - type: 'primary'  
26 - }  
27 - }, '这是render出来的');  
28 - }  
29 - })  
30 - },  
31 - success () {  
32 - this.$Message.success({  
33 - content: '这是一条成功的提示',  
34 - duration: 4 7 + loading () {
  8 + const msg = this.$Message.loading({
  9 + content: 'Loading...',
  10 + duration: 0
35 }); 11 });
  12 + setTimeout(msg, 103000);
36 }, 13 },
37 - warning () {  
38 - this.$Message.warning('这是一条警告的提示');  
39 - },  
40 - error () {  
41 - this.$Message.error('对方不想说话,并且向你抛出了一个异常');  
42 - },  
43 - destroy () {  
44 - this.$Message.destroy();  
45 - }  
46 - },  
47 - mounted () {  
48 -// this.$Message.config({  
49 -// top: 50,  
50 -// duration: 3  
51 -// });  
52 } 14 }
53 } 15 }
54 </script> 16 </script>
src/components/input/input.vue
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 <i class="ivu-icon" :class="['ivu-icon-ios-close-circle', prefixCls + '-icon', prefixCls + '-icon-clear' , prefixCls + '-icon-normal']" v-if="clearable && currentValue" @click="handleClear"></i> 5 <i class="ivu-icon" :class="['ivu-icon-ios-close-circle', prefixCls + '-icon', prefixCls + '-icon-clear' , prefixCls + '-icon-normal']" v-if="clearable && currentValue" @click="handleClear"></i>
6 <i class="ivu-icon" :class="['ivu-icon-' + icon, prefixCls + '-icon', prefixCls + '-icon-normal']" v-else-if="icon" @click="handleIconClick"></i> 6 <i class="ivu-icon" :class="['ivu-icon-' + icon, prefixCls + '-icon', prefixCls + '-icon-normal']" v-else-if="icon" @click="handleIconClick"></i>
7 <transition name="fade"> 7 <transition name="fade">
8 - <i class="ivu-icon ivu-icon-ios-sync ivu-load-loop" :class="[prefixCls + '-icon', prefixCls + '-icon-validate']" v-if="!icon"></i> 8 + <i class="ivu-icon ivu-icon-loading ivu-load-loop" :class="[prefixCls + '-icon', prefixCls + '-icon-validate']" v-if="!icon"></i>
9 </transition> 9 </transition>
10 <input 10 <input
11 :id="elementId" 11 :id="elementId"
src/components/message/index.js
@@ -17,7 +17,7 @@ const iconTypes = { @@ -17,7 +17,7 @@ const iconTypes = {
17 'success': 'ios-checkmark-circle', 17 'success': 'ios-checkmark-circle',
18 'warning': 'ios-alert', 18 'warning': 'ios-alert',
19 'error': 'ios-close-circle', 19 'error': 'ios-close-circle',
20 - 'loading': 'ios-sync' 20 + 'loading': 'loading'
21 }; 21 };
22 22
23 function getMessageInstance () { 23 function getMessageInstance () {
src/styles/common/iconfont/_ionicons-font.less
@@ -28,4 +28,22 @@ @@ -28,4 +28,22 @@
28 28
29 .ivu-icon { 29 .ivu-icon {
30 .ivu-icon(); 30 .ivu-icon();
  31 +}
  32 +
  33 +.ivu-icon-loading{
  34 + position: relative;
  35 + &::before{
  36 + content: "\F1F6";
  37 + }
  38 + &::after{
  39 + content: "";
  40 + display: block;
  41 + width: 50%;
  42 + height: 50%;
  43 + background: #fff;
  44 + position: absolute;
  45 + top: 1px;
  46 + left: 50%;
  47 + }
  48 +
31 } 49 }
32 \ No newline at end of file 50 \ No newline at end of file