代码拉取完成,页面将自动刷新
启用x轴滚动,touch事件报错(微信小程序)
gitee下载最新的文件[/uCharts-for-微信小程序(原生)/u-charts.min.js], 微信小程序中,启用x轴滚动,touch事件报错
TypeError: Cannot read property 'changedTouches' of undefined
at Charts.scrollStart (http://127.0.0.1:56921/appservice/plugin/ucharts/u-charts.min.js:2265:16)
分析:
源码中获取touches时使用了e.mp,而微信小程序中e.mp=undefined,导致出错。
Charts.prototype.scrollStart = function(e) {
var touches = e.mp.changedTouches[0] || e.changedTouches[0];
var _touches$ = getTouches(touches, this.opts, e);
if (touches && this.opts.enableScroll === true) {
if (touches.x) {
this.scrollOption.startTouchX = _touches$.x;
} else {
this.scrollOption.startTouchX = _touches$.clientX;
}
}
};