🔨 Use Icon component in Button

This commit is contained in:
jingsam 2016-11-30 13:25:58 +08:00
parent 24b201465e
commit 9817ce9981

View file

@ -1,7 +1,7 @@
<template>
<button :type="htmlType" :class="classes" :disabled="disabled">
<i :class="loadingIconClasses" v-if="loading"></i>
<i :class="typeIconClasses" v-if="icon && !loading"></i>
<Icon class="ivu-load-loop" type="load-c" v-if="loading"></Icon>
<Icon :type="icon" v-if="icon && !loading"></Icon>
<span v-if="showSlot" v-el:slot><slot></slot></span>
</button>
</template>
@ -62,17 +62,6 @@
[`${prefixCls}-icon-only`]: !this.showSlot && (!!this.icon || this.loading)
}
]
},
loadingIconClasses () {
return `${iconPrefixCls} ivu-load-loop ${iconPrefixCls}-load-c`;
},
typeIconClasses () {
return [
`${iconPrefixCls}`,
{
[`${iconPrefixCls}-${this.icon}`]: !!this.icon
}
]
}
},
compiled () {