ambit-tsai / echarts-for-vue

📊 📈 ECharts wrapper component for Vue 3, 2 and TypeScript
Apache License 2.0
80 stars 11 forks source link

Cannot read property 'init' of undefined #8

Closed callmesoul closed 3 years ago

callmesoul commented 3 years ago

Cannot read property 'init' of undefined

echarts 5.0以上会报这个错,降到4.9就可以了

ambit-tsai commented 3 years ago

从报错来看,是echarts对象没有正确引进导致的。官方建议通过如下方式引进:

  1. 使用 ES Module
    import * as echarts from 'echarts';
  2. 使用 CommonJS
    const echarts = require('echarts');

    详见 官方文档