浏览代码

perf: echarts

xiaoxian521 4 年之前
父节点
当前提交
7df600bea2
共有 2 个文件被更改,包括 3 次插入33 次删除
  1. 1 27
      src/plugins/echarts/index.ts
  2. 2 6
      src/views/welcome.vue

+ 1 - 27
src/plugins/echarts/index.ts

@@ -1,28 +1,14 @@
 import * as echarts from "echarts/core";
 
-import {
-  BarChart,
-  LineChart,
-  PieChart,
-  MapChart,
-  PictorialBarChart,
-  RadarChart,
-} from "echarts/charts";
+import { LineChart } from "echarts/charts";
 
 import {
   TitleComponent,
   TooltipComponent,
   GridComponent,
-  PolarComponent,
-  AriaComponent,
-  ParallelComponent,
-  LegendComponent,
-  RadarComponent,
   ToolboxComponent,
   DataZoomComponent,
   VisualMapComponent,
-  TimelineComponent,
-  CalendarComponent,
 } from "echarts/components";
 
 import { SVGRenderer } from "echarts/renderers";
@@ -30,26 +16,14 @@ import { SVGRenderer } from "echarts/renderers";
 const { use, registerTheme } = echarts;
 
 use([
-  LegendComponent,
   TitleComponent,
   TooltipComponent,
   GridComponent,
-  PolarComponent,
-  AriaComponent,
-  ParallelComponent,
-  BarChart,
   LineChart,
-  PieChart,
-  MapChart,
-  RadarChart,
   SVGRenderer,
-  PictorialBarChart,
-  RadarComponent,
   ToolboxComponent,
   DataZoomComponent,
   VisualMapComponent,
-  TimelineComponent,
-  CalendarComponent,
 ]);
 
 // 自定义主题

+ 2 - 6
src/views/welcome.vue

@@ -30,9 +30,9 @@
 import Flop from "/@/components/Flop";
 import { ref, computed, onMounted, nextTick } from "vue";
 import { deviceDetection } from "/@/utils/deviceDetection";
-import { echartsJson } from "/@/api/mock";
 import { useEventListener, tryOnUnmounted, useTimeoutFn } from "@vueuse/core";
-import * as echarts from "echarts";
+import { echartsJson } from "/@/api/mock";
+import echarts from "/@/plugins/echarts";
 
 let brokenLine: any = null; //折线图实例
 export default {
@@ -91,10 +91,6 @@ export default {
           toolbox: {
             right: 10,
             feature: {
-              dataZoom: {
-                yAxisIndex: "none"
-              },
-              restore: {},
               saveAsImage: {}
             }
           },