Switch add loading prop
This commit is contained in:
parent
ac2f8493b1
commit
eb7f31db00
3 changed files with 65 additions and 9 deletions
|
@ -45,6 +45,10 @@
|
|||
},
|
||||
name: {
|
||||
type: String
|
||||
},
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data () {
|
||||
|
@ -59,7 +63,8 @@
|
|||
{
|
||||
[`${prefixCls}-checked`]: this.currentValue === this.trueValue,
|
||||
[`${prefixCls}-disabled`]: this.disabled,
|
||||
[`${prefixCls}-${this.size}`]: !!this.size
|
||||
[`${prefixCls}-${this.size}`]: !!this.size,
|
||||
[`${prefixCls}-loading`]: this.loading,
|
||||
}
|
||||
];
|
||||
},
|
||||
|
@ -70,7 +75,7 @@
|
|||
methods: {
|
||||
toggle (event) {
|
||||
event.preventDefault();
|
||||
if (this.disabled) {
|
||||
if (this.disabled || this.loading) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue