echarts的各种操作报错Cannot read properties of undefined (reading ‘type‘)
·
先说解决方案:
在声明用于接收echarts实例的变量时,不可以使用refAPI,建议使用shallowRefAPI或直接声明变量接收
//声明用于接收echarts实例的变量
let my1Chart: echarts.ECharts | null = null;
// 初始化echarts实例
my1Chart = echarts.init(charDom.value);
官方解释:


更多推荐



所有评论(0)