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')
posted @ 2021-07-23 22:27  不叫一日闲过  阅读(2310)  评论(0编辑  收藏  举报