首页 > 其他分享 >控制台报错TypeError: Cannot read properties of null (reading ‘getAttribute‘)

控制台报错TypeError: Cannot read properties of null (reading ‘getAttribute‘)

时间:2023-03-06 11:56:57浏览次数:67  
标签:TypeError read getAttribute Cannot 报错 reading null echarts

其实是echarts属性报错:

获取不到属性名,初始化echarts的时候是在created钩子函数里面,那时候dom还没有生成,所以找不到id就会报错。
其实很简单,只要在mounted钩子函数里面去初始化echarts就行了。

 

 参考:https://blog.csdn.net/weixin_53791978/article/details/126506879

标签:TypeError,read,getAttribute,Cannot,报错,reading,null,echarts
From: https://www.cnblogs.com/zqlym/p/17183209.html

相关文章