Error reporting reason
DOM has not been mounted yet, echarts.init() has already started execution
resolvent
1. Don’t use created, use mounted. Created just creates an instance at this time, but the template hasn’t been mounted yet
created:Called before the template is rendered into html, i.e. usually initialize some property values and then render into view.
mounted: called after the template is rendered into html, usually after initializing the page and then doing some required operations on the html dom nodes
That is to say, the created()
method is called before the page is loaded, and DOM is not loaded yet. So use mounted
when DOM is changed, and use created
when DOM is not changed
2. Use setTimeout to delay loading
Read More:
- Nuxt integrate with qiankun as the main application Error: SKIP_BECAUSE_BROKEN
- Vue Error: error in mounted hook: TypeError: invalid src type
- Vuepress build error: window is not defined [How to Solve]
- [Solved] echarts Draw Errror: echarts-d9fd185e.js:31447 Uncaught (in promise) Error: Initialize failed: invalid dom.
- Vue init webpack Error: unable to verify the first certificate
- uniapp Use render Function Error: [Vue warn]: Error in beforeCreate hook: “TypeError: Cannot read property ‘_i‘ of
- Vant Applet: The Usage of Vant-dialog in Before-close
- Vue refreshes the current page (no flash screen will appear)
- [Solved] Vue Error: Uncaught TypeError: Vue.createApp is not a function
- [Solved] Echarts Error: Uncaught (in promise) Error: Initialize failed: invalid dom.
- Use of $watch in Vue (solve rangeerror: maximum call stack size exceeded)
- [Solved] VUE D:\project\vueProject\vue-02\src\components\hello.vue 5:5 error Parsing error: x-invalid-end-tag
- Vue Error: Maximum call stack size exceeded
- Vue: initialize failed: invalid DOM [How to Solve]
- “Failed to load resource: net::ERR_FILE_NOT_FOUND” error. The project created by vue-cli 3.0 can run under dev, and an error is reported after packaging, and the page is blank.
- Antdesignvue autocomplet completes the problem of repeated error reporting
- [Solved] Vue Error: TypeError: Cannot read property ‘end‘ of undefined
- [Vue warn]: Error in render: “TypeError: Cannot read properties of undefined
- [Solved] Syntax Error: TypeError: Cannot read property ‘parseComponent‘ of undefined
- Bugly automatically upload script and report zip error: nothing to do! In xcode10