vue3+echarts bug -- Cannot read properties of undefined (reading ‘type‘)

  • 下面是用vue3渲染echarts的代码, 可以正常执行





  •  但是会出现如下问题, let data = reactive({ chartInstance:{} });  chartInstance是proxy类型
     

vue3+echarts bug -- Cannot read properties of undefined (reading ‘type‘)_第1张图片

  • 定义图表实例为reactive类型,可解决上述问题,原因我想是因为图表实例是个对象,所以要写成reactive类型,才能监听到图表的变化
  • let chartInstance = reactive({}),chartInstance类型如下

vue3+echarts bug -- Cannot read properties of undefined (reading ‘type‘)_第2张图片

你可能感兴趣的:(#,vue,前端,前端,vue.js)