vue引入echarts报错:Error in mounted hook: "TypeError: Cannot read property 'init' of undefined"

背景

引入echarts后调用报错
[Vue warn]: Error in mounted hook: "TypeError: Cannot read property 'init' of undefined"

原因

引入方式有误

import echarts from 'echarts'

解决办法

换个引入方式
let echarts = require('echarts')
原文地址:https://www.cnblogs.com/xihailong/p/15054040.html