vue使用echarts报错:Error in mounted hook: "TypeError: this.dom.getContext is not a function"
// let c_dom = this.JQ('#overview_echarts');
let c_dom = this.$refs.overview_echarts;
this.E.init(c_dom).setOption(this.option)
一开始是使用jQuery获取dom,一直报上面的错误,后来改变用vue的ref获取就可以了
使用document.getelementById()获取也会报错
博客主要讲述了在Vue中使用ECharts时遇到的报错问题,即 'Error in mounted hook: \TypeError: this.dom.getContext is not a function\'。最初用jQuery获取dom会报错,使用document.getelementById()获取同样报错,后来改用Vue的ref获取则解决了问题。
11万+

被折叠的 条评论
为什么被折叠?



