echart报错:TypeError: Cannot read properties of null (reading ‘getAttribute‘)“

echart报错:TypeError: Cannot read properties of null (reading ‘getAttribute‘)“_第1张图片

原因: 由于echart需要的值没有获取到,明明接口返回数据了。

因为数据渲染方法加到了create:{}里面了,说明数据还未取到,界面已经加载了

解决方法:可以将数据渲染方法加到mounted(){}方法里,也可以将加载方法写到获取数据之后即可

你可能感兴趣的:(vue.js,javascript,开发语言)