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