报错:TypeError: Cannot read properties of undefined reading 'init'
1. 报错的样子2. 报错的原因3. 解决的方法4. 控制台不再报错
1. 报错的样子
在vue当中引用echarts,控制台报错: “TypeError: Cannot read properties of undefined (reading ‘init‘)
2. 报错的原因
报错是因为我们引用了echarts里面的init方法显示没有定义
3. 解决的方法
将import echarts from 'echarts' 的引入方式改为:import * as echarts from 'echarts'
4. 控制台不再报错
推荐文章
评论可见,请评论后查看内容,谢谢!!!
发表评论