背景

引入echarts后调用报错
[Vue warn]: Error in mounted hook: "TypeError: Cannot read property 'init' of undefined"
vue引入echarts报错:Error in mounted hook: "TypeError: Cannot read property 'init' of undefined"

原因

引入方式有误

import echarts from 'echarts'

解决办法

换个引入方式
let echarts = require('echarts')

相关文章:

  • 2022-12-23
  • 2021-12-25
  • 2022-12-23
  • 2021-08-06
  • 2022-12-23
  • 2021-04-28
  • 2021-09-17
  • 2022-12-23
猜你喜欢
  • 2021-08-06
  • 2021-06-12
  • 2022-12-23
  • 2021-08-21
  • 2022-12-23
相关资源
相似解决方案