var query = this.createSelectorQuery();
query.select('.ec-canvas').boundingClientRect(function (res) {
console.log('query');
if (typeof callback === 'function') {
_this.chart = callback(canvas, res.width, res.height);
} else if (_this.ec && typeof _this.ec.onInit === 'function') {
_this.chart = _this.ec.onInit(canvas, res.width, res.height);
} else if (_this.ec && _this.ec.options) {
var ec = _this.ec;
console.log('--options--');
_this.chart = initChart(canvas, res.width, res.height, ec);
} else {
_this.triggerEvent('init', {
canvas: canvas,
width: res.width,
height: res.height
});
}
}).exec();
请具体描述问题并提供能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)