在一个已有VUE项目中引入echarts报错如下:
[Vue warn]: Error in mounted hook: "TypeError: Cannot read properties of undefined (reading 'init')"
可能引起错误的原因是echarts引入方式错误
import echarts from 'echarts'
换个引入方式:
let echarts = require('echarts')
上面报错就解决了
在一个已有VUE项目中引入echarts报错如下:
[Vue warn]: Error in mounted hook: "TypeError: Cannot read properties of undefined (reading 'init')"
可能引起错误的原因是echarts引入方式错误
import echarts from 'echarts'
换个引入方式:
let echarts = require('echarts')
上面报错就解决了