mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
29 lines
465 B
JavaScript
29 lines
465 B
JavaScript
Component({
|
|
properties: {
|
|
checked: {
|
|
type: Boolean,
|
|
value: false
|
|
},
|
|
|
|
loading: {
|
|
type: Boolean,
|
|
value: false
|
|
},
|
|
|
|
disabled: {
|
|
type: Boolean,
|
|
value: false
|
|
}
|
|
},
|
|
|
|
methods: {
|
|
handleZanSwitchChange(event) {
|
|
if (this.data.loading || this.data.disabled) {
|
|
return;
|
|
}
|
|
let checked = !this.data.checked;
|
|
this.triggerEvent('change', event, { loading, checked });
|
|
}
|
|
}
|
|
});
|