使用echarts 时候在main.js中引入发现还是undefined,
在这里插入图片描述
把引入语句改为这个就可以了。

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

后面再全局引入就可以使用了。

Logo

Vue社区为您提供最前沿的新闻资讯和知识内容

更多推荐