2018-04-30 23:50:08 +08:00

32 lines
494 B
JavaScript

Component({
properties: {
checked: {
type: Boolean,
value: false
},
loading: {
type: Boolean,
value: false
},
disabled: {
type: Boolean,
value: false
}
},
methods: {
handleZanSwitchChange() {
if (this.data.loading || this.data.disabled) {
return;
}
let checked = !this.data.checked;
this.triggerEvent('change', {
checked,
loading: this.data.loading
});
}
}
});