You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
528 B
26 lines
528 B
2 years ago
|
var Switch = {
|
||
|
_handleZanSwitchChange(e) {
|
||
|
var dataset = e.currentTarget.dataset;
|
||
|
|
||
|
var checked = !dataset.checked;
|
||
|
var loading = dataset.loading;
|
||
|
var disabled = dataset.disabled;
|
||
|
var componentId = dataset.componentId;
|
||
|
|
||
|
if (loading || disabled) return;
|
||
|
|
||
|
|
||
|
|
||
|
if (this.handleZanSwitchChange) {
|
||
|
this.handleZanSwitchChange({
|
||
|
checked,
|
||
|
componentId
|
||
|
});
|
||
|
} else {
|
||
|
console.warn('页面缺少 handleZanSwitchChange 回调函数');
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
module.exports = Switch;
|