Vue使用Echarts出现TypeError Cannot read properties of null (reading ‘getAttribute‘)

如题所述

第1个回答  2022-06-08
每日一唠叨:
从某个页面时点击两次返回出现TypeError Cannot read properties of null (reading ‘getAttribute‘)错误,发现是Echarts的图形容器还未生成就跳转了别的页面进行其进行了初始化。

解决方法:将数据渲染方法加到mounted(){}方法里!