本文主要是介绍Error in nextTick: “TypeError: Cannot read properties of undefined (reading ‘getAttribute’)” 问题的解决,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
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);});}
这篇关于Error in nextTick: “TypeError: Cannot read properties of undefined (reading ‘getAttribute’)” 问题的解决的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!