ElemeFE / v-charts

基于 Vue2.0 和 ECharts 封装的图表组件📈📊
https://v-charts.js.org
MIT License
6.8k stars 1.99k forks source link

在typescript项目中使用,echarts方法不能使用 #652

Open startblingbling opened 5 years ago

startblingbling commented 5 years ago

在typescript项目中使用, this.$nextTick(_ => { this.$refs[chart1].echarts.resize() }) echarts这个方法不能使用,报错Unresolved variable echarts ,怎么解决呢?

doommm commented 5 years ago

手动标识类型就可以了,或者直接标识成any Vue里面对$refs的类型标注为$refs: { [key: string]: Vue | Element | Vue[] | Element[] };,默认认不出封装的v-chart组件,也认不出echarts的方法