Revert "Revert "update Button & style""
This reverts commit 518c639ada
.
This commit is contained in:
parent
518c639ada
commit
9e5c72833e
2 changed files with 5 additions and 17 deletions
|
@ -3,9 +3,7 @@
|
|||
:type="htmlType"
|
||||
:class="classes"
|
||||
:disabled="disabled"
|
||||
@blur="handleBlur"
|
||||
@click="handleClick"
|
||||
@focus="handleFocus">
|
||||
@click="handleClick">
|
||||
<Icon class="ivu-load-loop" type="load-c" v-if="loading"></Icon>
|
||||
<Icon :type="icon" v-if="icon && !loading"></Icon>
|
||||
<span v-if="showSlot" ref="slot"><slot></slot></span>
|
||||
|
@ -52,7 +50,6 @@
|
|||
},
|
||||
data () {
|
||||
return {
|
||||
isFocused: false,
|
||||
showSlot: true
|
||||
};
|
||||
},
|
||||
|
@ -66,22 +63,15 @@
|
|||
[`${prefixCls}-${this.shape}`]: !!this.shape,
|
||||
[`${prefixCls}-${this.size}`]: !!this.size,
|
||||
[`${prefixCls}-loading`]: this.loading != null && this.loading,
|
||||
[`${prefixCls}-icon-only`]: !this.showSlot && (!!this.icon || this.loading),
|
||||
[`${prefixCls}-focused`]: this.isFocused
|
||||
[`${prefixCls}-icon-only`]: !this.showSlot && (!!this.icon || this.loading)
|
||||
}
|
||||
];
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleBlur () {
|
||||
this.isFocused = false;
|
||||
},
|
||||
handleClick (event) {
|
||||
this.$emit('click', event);
|
||||
},
|
||||
handleFocus () {
|
||||
this.isFocused = true;
|
||||
},
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.showSlot = this.$slots.default !== undefined;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue