background
After the introduction of echarts, an error is reported when calling
[Vue warn]: Error in mounted hook: “TypeError: Cannot read property’init’ of undefined”
reason
Wrong way of introduction
import echarts from 'echarts'
Solution
change the import method
let echarts = require('echarts')
Similar Posts:
- [Solved] Vue Import echarts Error: export ‘default‘ (imported as ‘echarts‘) was not found in ‘echarts‘
- [Solved] TypeError: Cannot read property ‘getAttribute’ of undefined
- How to Copy Echarts Map Examples to Local vueCLI Project (Commissioning Operation)
- [Solved] Error: `resize` should not be called during main process.
- How to Solve Vue Import Chinese Map & Echarts Import China Error
- Vue: How to use Vue-router in Axios
- Electronic error: Uncaught TypeError: Cannot read property ‘dialog’ of undefined
- Vue configures the compression-webpack-plugin to package and compress JS and CSS Error
- ECharts Error: Uncaught Error: `setOption` should not be called during main process