VUE mounted dom null

A normal page rendering, which is not engineered, is directly introduced into vue, an ordinary page rendering. I have tried to obtain data in created and mounted. Because I used echarts, I tried to initialize echarts, in mounted, but I could not find dom. I read the lifecycle carefully again, but still could not solve this problem after using nextTick. During the attempt, mounted acquired dom as null by accident. I don"t know if my asynchronous load data affects it.

Oct.15,2021

it feels like you may not have successfully loaded the echarts when you were getting the dom.


code is posted to know the reason


this problem is entirely a matter of personal use, or just check for errors according to the life cycle of vue.

Menu