0
点赞
收藏
分享

微信扫一扫

Vue整合Echarts报错:“TypeError: Cannot read properties of undefined (reading ‘init‘)“


        Vue整合完Echart使用的时候报错:"TypeError: Cannot read properties of undefined (reading 'init')" 大概意思是无法读取未定义的属性(init)

Vue整合Echarts报错:“TypeError: Cannot read properties of undefined (reading ‘init‘)“_echarts

        在网上引用echarts的写法是在main.js 引入这两行

// 引入echarts
import echarts from 'echarts'
Vue.prototype.$echarts = echarts

 

Vue整合Echarts报错:“TypeError: Cannot read properties of undefined (reading ‘init‘)“_java_02

这是错误的写法 正确的是 

import * as echarts from 'echarts'
Vue.prototype.$echarts = echarts

 

Vue整合Echarts报错:“TypeError: Cannot read properties of undefined (reading ‘init‘)“_java_03

Vue整合Echarts报错:“TypeError: Cannot read properties of undefined (reading ‘init‘)“_javascript_04

举报

相关推荐

0 条评论