Tag Archives: Vue Import echarts error

[Solved] Vue Import echarts error: Error in mounted hook: “TypeError: Cannot read property ‘init’ of undefined”

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')