echarts 画图报错 this.dom.getContext is not a function

 

 我给 <el-card>绑定了ref,利用$refs获取 echarts实例

 const echarts1 = echarts.init(this.$refs.echarts1);
结果报错了
解决办法:
<el-card style="width: 100%; height: 260px">
          <div ref="echarts1" style="height: 260px"></div>
</el-card>
把ref绑定在div上就对了
 
posted @ 2023-02-23 17:47  桃月有八  阅读(972)  评论(0)    收藏  举报