原本是按照https://ask.dcloud.net.cn/article/19727这个方法引入 mpvue-echarts,能成功运行。
但是用npm方式引入echarts:
import echarts from 'echarts'
import mpvueEcharts from 'mpvue-echarts'
替换原来的:
import * as echarts from '@/components/echarts/echarts.simple.min.js';
import mpvueEcharts from '@/components/mpvue-echarts/src/echarts.vue';
就会报错:
index.umd.min.js:1 [system] errorHandler TypeError: el.addEventListener is not a function
at addEventListener (event.js:138)
at HandlerDomProxy.<anonymous> (HandlerProxy.js:288)
at Array.forEach (<anonymous>)
at Object.each (util.js:298)
at mountHandlers (HandlerProxy.js:287)
at new HandlerDomProxy (HandlerProxy.js:274)
at new ZRender (zrender.js:138)
at Object.init (zrender.js:49)
at new ECharts (echarts.js:194)
at Object.init (echarts.js:1813) Vue {_uid: 1, _isVue: true, $options: {…}, _renderProxy: Proxy, _self: Vue, …} event handler for "view.onRequestComponentInfo"
请问什么原因呢
1***@qq.com
大佬安卓端报 this.echarts.setCanvasCreator is not a function 错误知道怎么解决么
2019-05-01 17:33
不是发哥
回复 1***@qq.com: 请尝试延时执行
2019-05-01 19:30
yiyixun (作者)
感谢回答 不过npm的echarts里 哪个文件有function(t)?
2019-05-06 17:59
不是发哥
回复 yiyixun: echarts.min.js或者echarts.js
2019-05-08 10:21
z***@qq.com
回复 不是发哥: 有1400多个function(t)
2020-05-27 18:26
6***@qq.com
回复 z***@qq.com: 打开文本搜索 搜function 从上往下找 把第三个位置的function 修改即可
2021-05-27 16:39