我正在使用vue-apexharts来绘制图表,图表数据来自api。
this.statistics = response.data;
this.statistics.consent.map((consent) => {
this.series.push(consent.count);
});
但是显示错误-TypeError:无法读取未定义的属性“ map”
答案 0 :(得分:1)
以某种方式要执行map()函数时,this.statistics.consent
为空/空/未定义。尝试通过console.log(this.statistics.consent)
对其进行调试。希望对您有帮助,祝您好运!