报错信息
Uncaught Error: InvalidStateError: Failed to execute ‘drawImage’ on ‘CanvasRenderingContext2D’:The image argument is a canvas element with a width or height of 0.
报错原因:
这个错误通常是由于在 drawImage 方法中传递一个宽度或高度为0的 canvas 元素作为图像参数而引发的(没有给导出的图像设置宽或者高)。这种情况下,浏览器会抛出 “InvalidStateError” 错误。
解决办法
<chart :option="option" style="height: 200px;width: 100%;"></chart>