鍍金池/ 問(wèn)答/數(shù)據(jù)庫(kù)  HTML/ _echarts.init is not a function 這是什么問(wèn)題?

_echarts.init is not a function 這是什么問(wèn)題?

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

      const KnowledgeOPs = echarts.init(document.getElementById('containerKG'));
      報(bào)錯(cuò)_echarts.init is not a function 這是什么問(wèn)題?
回答
編輯回答
假灑脫

const echarts = require('echarts');
require('echarts-gl');
const KnowledgeOPs = echarts.init(document.getElementById('containerKG'));
這樣寫就不會(huì)報(bào)錯(cuò)了

2017年6月17日 00:20