Merge pull request #107 from jingsam/button
🔨 Use Icon component in Button
This commit is contained in:
commit
9419e0c52c
1 changed files with 2 additions and 14 deletions
|
@ -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 () {
|
||||
|
|
Loading…
Add table
Reference in a new issue