Solution:
1. Change
import echarts from 'echarts';
to
import * as echarts from 'echarts';
2. Reinstall echarts and uninstall echars5.x. Install echarts4.x. It can also solve the problem.
Solution:
1. Change
import echarts from 'echarts';
to
import * as echarts from 'echarts';
2. Reinstall echarts and uninstall echars5.x. Install echarts4.x. It can also solve the problem.
After the introduction of echarts, an error is reported when calling
[Vue warn]: Error in mounted hook: “TypeError: Cannot read property’init’ of undefined”
Wrong way of introduction
import echarts from 'echarts'
change the import method
let echarts = require('echarts')