_echarts.init is not a function 这是什么问题?

const echarts = require('echarts-gl');

      const KnowledgeOPs = echarts.init(document.getElementById('containerKG'));
      报错_echarts.init is not a function 这是什么问题?
阅读 19.3k
1 个回答

const echarts = require('echarts');
require('echarts-gl');
const KnowledgeOPs = echarts.init(document.getElementById('containerKG'));
这样写就不会报错了

推荐问题