根据mpvueecharts的官方github上的代码,放进自己页面,一运行就会报这个错误。求解答!
或者是有什么关于散点图的uniapp整合echarts的好方案嘛!谢谢
```java
[Vue warn]: Error in event handler for "view.onRequestComponentInfo": "TypeError: t.addEventListener is not a function"
(found in <Root>)
[system]TypeError: t.addEventListener is not a function
```
方便把代码贴出来看看吗?参考一下,是否有帮助。
<template>
<div class="app-container">
<div>
<v-chart :options="options" style="width: 100%;height:500px;" />
</div>
</div>
</template>
<script>
import { chart } from '@/api/sys/pay'
export default {
name: 'Dashboard',
data() {
return {
listQuery: {
years: '2021'
},
options: {
title: {
text: '停车场收款按月统计表',
subtext: '单位:元'
},
tooltip: {},
legend: {},
dataset: {
// 提供一份数据。
source: []
},
xAxis: {
type: 'category'
},
yAxis: {},
series: []
}
}
},
created() {
chart(this.listQuery).then(res => {
// this.options = res.data
// this.options = JSON.parse(res.data)
// this.options = JSON.stringify(res.data)
console.log(res.data)
this.options.title = res.data.options.title
this.options.dataset = res.data.options.dataset
this.options.series = res.data.options.series
this.options.legend = res.data.options.legend
this.options.tooltip = res.data.options.tooltip
this.options.xAxis = res.data.options.xAxis
this.options.yAxis = res.data.options.yAxis
})
},
methods: {
}
}
</script>
<style lang="scss" scoped>
</style>