Open startblingbling opened 5 years ago
在typescript项目中使用, this.$nextTick(_ => { this.$refs[chart1].echarts.resize() }) echarts这个方法不能使用,报错Unresolved variable echarts ,怎么解决呢?
手动标识类型就可以了,或者直接标识成any Vue里面对$refs的类型标注为$refs: { [key: string]: Vue | Element | Vue[] | Element[] };,默认认不出封装的v-chart组件,也认不出echarts的方法
any
$refs: { [key: string]: Vue | Element | Vue[] | Element[] };
在typescript项目中使用, this.$nextTick(_ => { this.$refs[chart1].echarts.resize() }) echarts这个方法不能使用,报错Unresolved variable echarts ,怎么解决呢?