Yao 451a3b19fc
[new feature] 增加 css 编译,方便组件书写 (#40)
* add src dir && add build

* add build watch && change dir name

* bower ignore package.json
2017-10-29 10:42:28 +08:00

26 lines
590 B
JavaScript

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;
console.info('[zan:switch:change]', { checked, componentId });
if (this.handleZanSwitchChange) {
this.handleZanSwitchChange({
checked,
componentId
});
} else {
console.warn('页面缺少 handleZanSwitchChange 回调函数');
}
}
};
module.exports = Switch;