Commit 9817ce9981116af9f312b9bce407b98892191d22
1 parent
24b20146
Use Icon component in Button
Showing
1 changed file
with
2 additions
and
13 deletions
Show diff stats
src/components/button/button.vue
1 | 1 | <template> |
2 | 2 | <button :type="htmlType" :class="classes" :disabled="disabled"> |
3 | - <i :class="loadingIconClasses" v-if="loading"></i> | |
4 | - <i :class="typeIconClasses" v-if="icon && !loading"></i> | |
3 | + <Icon class="ivu-load-loop" type="load-c" v-if="loading"></Icon> | |
4 | + <Icon :type="icon" v-if="icon && !loading"></Icon> | |
5 | 5 | <span v-if="showSlot" v-el:slot><slot></slot></span> |
6 | 6 | </button> |
7 | 7 | </template> |
... | ... | @@ -62,17 +62,6 @@ |
62 | 62 | [`${prefixCls}-icon-only`]: !this.showSlot && (!!this.icon || this.loading) |
63 | 63 | } |
64 | 64 | ] |
65 | - }, | |
66 | - loadingIconClasses () { | |
67 | - return `${iconPrefixCls} ivu-load-loop ${iconPrefixCls}-load-c`; | |
68 | - }, | |
69 | - typeIconClasses () { | |
70 | - return [ | |
71 | - `${iconPrefixCls}`, | |
72 | - { | |
73 | - [`${iconPrefixCls}-${this.icon}`]: !!this.icon | |
74 | - } | |
75 | - ] | |
76 | 65 | } |
77 | 66 | }, |
78 | 67 | compiled () { | ... | ... |