vue3 + echarts5 使用问题汇总

1. Cannot read properties of undefined (reading 'type')

原因:定义图表变量时使用reactive定义响应式变量。

const chartList = reactive({
  chart1: null
});

解决:改为非响应式变量。

// 方法一
const chartList = markRaw({
  chart1: null
});
// 方法二
const chartList = {
  chart1: null
};
// 方法三
const chart1 = null;
posted @ 2023-02-20 14:49  Li_pk  阅读(85)  评论(0)    收藏  举报