我又来了,我服,用个echarts咋这么难,一步一报错,这次又是啥?
报错详情:
"TypeError: Cannot read properties of undefined (reading 'init')"
这个问题出现的原因还是出现在版本上,我当前用的是5.2.2版本的echarts,官方文档中说:V5版本以上的引用echarts得代码相比之前V4需要进行修改。
使用者在 v4 中这样引用了 echarts:
import echarts from 'echarts'
那么在5以上的版本就得改成这样:import * as echarts from 'echarts'
试着这样改完之后,是不是报错消失了?