而不是<script src="http://code.highcharts.com/modules/exporting.js"></script>
使用webpack时如何将其添加为依赖项?是否在某些模块下可用?
您需要导入并初始化模块:
import Highcharts from 'highcharts';
import exporting from 'highcharts/modules/exporting';
exporting(Highcharts);
或使用要求:
import Highcharts from 'highcharts'
require("highcharts/modules/exporting")(Highcharts);
现场演示:https://stackblitz.com/edit/react-tepuf4?file=index.js
文件:https://www.highcharts.com/docs/getting-started/install-from-npm