Merge pull request #107 from jingsam/button

🔨 Use Icon component in Button
This commit is contained in:
Aresn 2016-11-30 13:35:33 +08:00 committed by GitHub
commit 9419e0c52c

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>
@ -10,7 +10,6 @@
import { oneOf } from '../../utils/assist';
const prefixCls = 'ivu-btn';
const iconPrefixCls = 'ivu-icon';
export default {
components: { Icon },
@ -62,17 +61,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 () {