- 将 ECOption 类型定义移至独立的 types.ts 文件 - 修改 echarts.ts 文件导入 ECOption 类型而不是定义 - 更新 index.ts 添加 types 导出 - 移除 echarts.ts 中冗余的类型导入和定义 - 添加完整的 README.md 文档说明插件使用方法 - 优化代码组织结构提高可维护性
37 lines
791 B
TypeScript
37 lines
791 B
TypeScript
export type { ECOption } from './types';
|
|
|
|
import { BarChart, LineChart, PieChart, RadarChart } from "echarts/charts";
|
|
import {
|
|
DatasetComponent,
|
|
GridComponent,
|
|
LegendComponent,
|
|
TitleComponent,
|
|
ToolboxComponent,
|
|
TooltipComponent,
|
|
TransformComponent
|
|
} from "echarts/components";
|
|
import * as echarts from "echarts/core";
|
|
import { LabelLayout, LegacyGridContainLabel, UniversalTransition } from "echarts/features";
|
|
import { CanvasRenderer } from "echarts/renderers";
|
|
|
|
|
|
echarts.use([
|
|
TitleComponent,
|
|
PieChart,
|
|
RadarChart,
|
|
TooltipComponent,
|
|
GridComponent,
|
|
DatasetComponent,
|
|
TransformComponent,
|
|
BarChart,
|
|
LineChart,
|
|
LabelLayout,
|
|
LegacyGridContainLabel,
|
|
UniversalTransition,
|
|
CanvasRenderer,
|
|
LegendComponent,
|
|
ToolboxComponent,
|
|
]);
|
|
|
|
export default echarts;
|