Skip to content

Export default

Posted on:June 5, 2023 at 03:51 AM
/**
 * @license @product.name@ JS v@product.version@ (@product.date@)
 *
 * (c) 2009-2016 Torstein Honsi
 *
 * License: www.highcharts.com/license
 */
'use strict';
import Highcharts from '../parts/Globals.js';
import '../parts/SvgRenderer.js';
import '../parts/Html.js';
import '../parts/Axis.js';
import '../parts/DateTimeAxis.js';
import '../parts/LogarithmicAxis.js';
import '../parts/PlotLineOrBand.js';
import '../parts/Tooltip.js';
import '../parts/Pointer.js';
import '../parts/TouchPointer.js';
import '../parts/MSPointer.js';
import '../parts/Legend.js';
import '../parts/Chart.js';
import '../parts/ScrollablePlotArea.js';
import '../parts/Stacking.js';
import '../parts/Dynamics.js';
import '../parts/AreaSeries.js';
import '../parts/SplineSeries.js';
import '../parts/AreaSplineSeries.js';
import '../parts/ColumnSeries.js';
import '../parts/BarSeries.js';
import '../parts/ScatterSeries.js';
import '../parts/PieSeries.js';
import '../parts/DataLabels.js';
import '../modules/overlapping-datalabels.src.js';
import '../parts/Interaction.js';
import '../parts/Responsive.js';
export default Highcharts;

直接查看引用

防止拼写错误
当你在开发时使用 import Foo from './foo' 时,并不会得到有关于拼写的任何错误,其他人可能会这么写 import foo from './foo';

#再次导出
再次导出是没必要的,但是在 npm 包的根文件 index 却是很常见。如:import Foo from './foo';export { Foo }(默认导出)VS export * from './foo' (命名导出)。