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

在网上引用echarts的写法是在main.js 引入这两行
// 引入echarts
import echarts from 'echarts'
Vue.prototype.$echarts = echarts

这是错误的写法 正确的是
import * as echarts from 'echarts'
Vue.prototype.$echarts = echarts












