Error in nextTick: “TypeError: Cannot read properties of undefined (reading ‘getAttribute’)” 问题的解决
报错 Cannot read properties of undefined
解决方法:加一个判断if (表示dom已存在),再执行this.nextTick() 方法
if (this.$refs.chart) {
this.$nextTick(() => {
let chart3 = this.$refs.chart3;
vm.myChart3 = this.$echarts.init(chart3);
vm.myChart3.setOption(option, true);
});
}