Uncaught TypeError: Cannot read properties of undefined (reading 'type') from echarts resolve
DON'T use ref or reactive to wrap the echarts instance. Use a common variable or shallowRef to avoid the deep watch for echarts instance.
不要使用 ref 或 reactive 来包装 echarts 实例。使用公共变量或 shallowRef 来避免对 echarts 实例的深度监视。
<template>
  <div ref='refMain' ></div>
</template>
  import { shallowRef, onMounted } from 'vue';
  const myChart = shallowRef();
  const refMain = ref(null);
  onMounted(() => {
    // 获取图表容器的 DOM 元素
    const chartDom = refMain.value;
    // 初始化
    myChart.value = echarts.init(chartDom);
  });
 
                     
                    
                 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号