Explorar o código

Merge branch 'master' of http://39.97.59.228:8013/hrx/mky-vent-base

bobo04052021@163.com hai 1 mes
pai
achega
46a5dd337f
Modificáronse 1 ficheiros con 6 adicións e 4 borrados
  1. 6 4
      src/hooks/web/useECharts.ts

+ 6 - 4
src/hooks/web/useECharts.ts

@@ -9,9 +9,11 @@ import { useBreakpoint } from '/@/hooks/event/useBreakpoint';
 import echarts from '/@/utils/lib/echarts';
 import { useRootSetting } from '/@/hooks/setting/useRootSetting';
 
-export function useECharts(elRef: Ref<HTMLDivElement>, theme: 'light' | 'dark' | 'default' = 'default') {
-  console.log("---useECharts---初始化加载---")
-
+export function useECharts(
+  elRef: Ref<HTMLDivElement>,
+  theme: 'light' | 'dark' | 'default' = 'default',
+  opt: echarts.EChartsInitOpts = { renderer: 'svg' }
+) {
   const { getDarkMode: getSysDarkMode } = useRootSetting();
 
   const getDarkMode = computed(() => {
@@ -40,7 +42,7 @@ export function useECharts(elRef: Ref<HTMLDivElement>, theme: 'light' | 'dark' |
       return;
     }
 
-    chartInstance = echarts.init(el, t, );
+    chartInstance = echarts.init(el, t, opt);
     const { removeEvent } = useEventListener({
       el: window,
       name: 'resize',