使用 ES Module 引入echarts后 初始化时报错:echarts.init is not a function

新手上路,请多包涵

import echarts from 'pool/echarts/dist/echarts';
echarts.init(document.getElementById('userChart'))
已经取到js,但是echarts对象好像不对
clipboard.png

阅读 9.6k
2 个回答
import echarts from "echarts/lib/echarts";

这样吧

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题