add console warn for callback

This commit is contained in:
Nino 2016-12-20 14:24:53 +08:00
parent 2952e1b311
commit 064c96cdec
2 changed files with 11 additions and 12 deletions

View File

@ -10,11 +10,14 @@ function handle(e, num) {
}
function callback(componentId, quantity) {
quantity = +quantity;
var e = { componentId, quantity };
console.info('[zui:quantity:change]', e);
if (this.handleZuiQuantityChange) {
quantity = +quantity;
var e = { componentId, quantity };
console.info('[ZUI:Quantity:Change]', e);
this.handleZuiQuantityChange(e);
} else {
console.warn('页面缺少 handleZuiQuantityChange 回调函数');
}
}

14
dist/tab/index.js vendored
View File

@ -3,18 +3,14 @@ var Tab = {
var dataset = e.currentTarget.dataset;
var componentId = dataset.componentId;
var selectedId = dataset.itemId;
var data = { componentId, selectedId };
console.info('[zui:tab:change]', data);
if (this.handleZuiTabChange) {
console.info('[ZUI:Tab:Change]', {
componentId,
selectedId
});
this.handleZuiTabChange({
componentId,
selectedId
});
this.handleZuiTabChange(data);
} else {
console.warn('页面缺少 handleZuiTabChange 回调函数');
}
}
};
module.exports = Tab;