Echart按需引入时报错---[ECharts] Component legend(‘XX‘) is used but not imported.
[ECharts] Component legend(‘XX’) is used but not imported.

解决:
import { LegendComponent } from 'echarts/components';
echarts.use([LegendComponent]);

import { LegendComponent } from 'echarts/components';
echarts.use([LegendComponent]);