使用heatmap.js出现Cannot assign to read only property ‘data‘ of object ‘#<ImageData>‘问题。

Cannot assign to read only property ‘data’ of object ImageData 问题解决
去你的node_modules/heatmap.js/build/heatmap.js 文件下,找到527行
你会发现
你会发现正是img.data = imgData出的错。
错误原因,大概是
“data property seems to be read only on certain browser versions. To fix it, we need to delete this line because and points to the same reference. Any modifications you do to is already reflected to”
data属性似乎仅在某些浏览器版本上是只读的。要修复它,我们需要删除此行,因为 和 指向相同的引用。您所做的任何修改都已反映在 中。我很快就会提出公关

所以我们注掉这行就ok了。

答案参考github:https://github.com/pa7/heatmap.js/issues/219

改完了文件别忘了保存然后 重新npm build

猜你喜欢

转载自blog.csdn.net/qq_43952288/article/details/132067176