How to Solve the error: initialize failed invalid dom

Problem scenario

In Vue project   Introducing echorts as a component

The screenshot of error reporting is as follows

Solution:

Originally, document.getelementbyid was used according to the official website

Changed to

Read More: