首页 > 其他 > 详细

Error in mounted hook: "TypeError: Cannot read property 'init' of undefined"

时间:2021-06-25 10:11:15      阅读:21      评论:0      收藏:0      [点我收藏+]

1.安装echarts依赖

  npm install echarts --save-dev

2.main.js中全局引用

  import echarts from ‘echarts‘
  Vue.prototype.$echarts = echarts 

3.运行中报错

  技术分享图片

4.解决办法

  将 main.js中的引用 import echarts from ‘echarts‘ 改为 import * as echarts from ‘echarts‘

5.测试

  技术分享图片

 

 6.效果

  技术分享图片

 

 

 


技术分享图片

 

Error in mounted hook: "TypeError: Cannot read property 'init' of undefined"

原文:https://www.cnblogs.com/zq01/p/14929082.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!