🔨 Use Icon component in Button
This commit is contained in:
parent
24b201465e
commit
9817ce9981
1 changed files with 2 additions and 13 deletions
|
@ -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 () {
|
||||||
|
|
Loading…
Add table
Reference in a new issue