使用Echart报错Cannot read property ‘getAttribute‘ of undefined

echarts dataZoom 组件报Cannot read properties of undefined (reading ‘type‘) 使用dataZoom组件,拖拽时报Cannot read properties of undefined (reading 'type')错误,且拖拽不生效问题解决方案。 阅读详情

项目中使用Echart报错,百度结果说生命周期性错误,解决办法是

  mounted() {
    this.$nextTick(() => {
      this.drawLine();
    });
  }

此方法可以解决百分之90的错误,还有百分之十是因为

在mounted里写nexttick 结果发现 打印结果还是 没有找到继续报错,

最后 发现, 写Echart的盒子 不能放到 for 循环里面 不然 这个盒子 ref是找不到他的,需要放到for 循环外面。

最后 打印结果 盒子成功找到。

避开CPU瓶颈:手把手教你用RK3588的DMA-BUF实现V4L2到NPU的零拷贝数据流 本文详细介绍了如何在RK3588平台上利用DMA-BUF实现V4L2到NPU的零拷贝数据流,显著提升异构计算性能。通过实战指南展示了如何配置摄像头采集、RGA图像预处理和NPU推理优化,最终实现CPU占用率降低60%、延迟减少60%的效果,特别适合YOLOv5等AI推理应用的高效部署。 阅读详情

相关推荐

Pytorch transformers tokenizer 分词器词汇表添加新的词语和embedding

NLP添加新词汇

7287

Vue+Echarts】天坑 子组件中的Echarts Cannot read properties of undefined (reading ‘getAttribute‘)“

报错 Error in nextTick: “TypeError: Cannot read properties of undefined (reading ‘getAttribute’)”

sakura22123的博客 2164

matlab_R2021b_maci64.dmg (mac版本,可用!)

matlab for mac

Element UI&ECharts报错:TypeError: Cannot read properties of undefined (reading ‘getAttribute‘)

TypeError: Cannot read properties of undefined (reading 'getAttribute')

weixin_43913958的博客 2592

Echars 报错: Error in created hook: “Cannot read properties of undefined (reading ‘getAttribute‘)“

Echars 报错:Error in created hook: "TypeError: Cannot read properties of undefined (reading 'getAttribute')"

weixin_57529171的博客 8888

Vue中监听数据变化并初始化ECharts时“Cannot read properties of undefined (reading ‘getAttribute‘)“错误

当通过监听器获取到value值的变化,并据此调用相应函数时,虽然DOM理论上已完成更新,但在根据特定值(如6)触发展示逻辑并尝试初始化ECharts图表时,可能会遇到一个情况:即在执行初始化方法前,通过ref引用的DOM元素实际上尚未加载完毕或未被Vue实例正确关联。因此,在初始化ECharts图表并试图访问该DOM元素属性时,就会导致“Cannot read properties of undefined (reading 'getAttribute')"的错误。 为了确保在初始化ECharts图表时D

qq_44866810的博客 1141

echart报错 Cannot read propertygetAttributeof undefined

Error in created hook: "TypeError: Cannot read property 'getAttribute' of undefined" 用的Vue,第一反应是echart的引用错误,然后用cdn的方式引入,也是这样的错,最后发现是生命周期的原因 用的created调用方法 官方说明:实例已经创建完成之后被调用。在这一步,实例已完成以下的配置:数据观测(data observer),属性和方法的运算, watch/event 事件回调。然而,挂载阶段还没开始,$el .

lojieo的博客 1万+

echart 报错Cannot read propertygetAttributeof undefined

要等dom加载完之后在加载图表否则就会报这个错误 加上这句代码 就能解决 this.$nextTick(function(){ this.drawpowerline() })

qq_42180156的博客 348

vue中引用echarts出现TypeError: Cannot read property 'getAttribute' of undefined

this.$nextTick(() => {xxx}); 解决vue中引用echarts出现"TypeError: Cannot read property 'getAttribute' of undefined"错误。 在调用echarts的位置直接使用上述方法即可,不需要像很多人说的非要在 "mounted"之中调用。 例如: //统计图 sta...

weixin_42095871的博客 2417

vue echarts Error in nextTick: “TypeError: Cannot read propertygetAttributeof undefined

写在前面:导致 Error in nextTick: “TypeError: Cannot read propertygetAttributeof undefined报错原因就是因为获取不到页面的元素,导致这种报错的因素很多种,我这里至少记录下在vue子组件件中使用echart获取不到页面元素,使用vue插槽解决。 1. 报错 Error in nextTick: "TypeError: Cannot read property 'getAttribute' of undefined" 2..

@必意玲 1万+

报错Cannot read propertygetAttributeof undefined解决办法

报错Cannot read property 'getAttribute' of undefined的解决办法不同于其他问题我的解决方法 不同于其他问题 属于个人的小笔记,如果能帮助到大家那更好。 就是今天在渲染echarts环形图的时候,总是报一个找不到对象的问题。 在网上找了好多资料,什么在mounted里执行渲染echarts的方法,在回调函数this.$nextTick()里渲染方法,延时。。。都不好用。 我的解决方法 后来在调用接口成功以后再执行渲染echarts的方法就好了。个人理解是,数

B_cherry的博客 7331

echarts报错 Cannot read propertygetAttributeof undefined

今天在review代码时,发现控制台莫名报错Cannot read property 'getAttribute' of undefined 通过查看,问题定位在这一行,也就是echarts初始化的时候: const chart = echarts.init(this.$refs['chart']); 结合报错信息可以得知,错误原因是因为没获取到dom属性。 在vue中获取不到dom一般分为两种情况,一是在created中获取,这个时候只是创建了vue实例,dom并没有开始渲染。所以自然拿不到.

飘来荡去这一生 5032

TypeError:cannot read propertygetAttributeof undefined

报错场景:页面切换路由时报错 报错原因:使用 Vue + echarts,因为 页面中使用echarts 图表,在初始化图表后,dom 元素还未被初始化加载出来,导致 echarts 在渲染时候报错 示例代码: drawPie(){ // 总体告警数 饼图 // 基于准备好的dom,初始化echarts实例 let ref = this.$refs.pie if (ref && ref !== undefined) { let myChart = this.$

风如也的博客 2468

关于JS报错Cannot read property 'getAttribute' of null问题

关于JS报错Cannot read propertygetAttributeof null问题 出错原因 在vue使用echarts时,在图表元素并未加载的情况下进行eharts.init(),会发生此错误,因为eharts并未找到该元素,故无法对其进行渲染。 echarts.js引用放在head中或者放在body中HTML代码的前面了,造成加载时阻塞后面的html。 解决方案 查...

“跟他人学,和自己比” 2440

开发需求总结17-vue echart报错Cannot read property get ‘Attribute‘ of undefined

看到这个报错,强迫症患者贼难受。。。页面明明没有任何问题,但就是一直在切换echart图表显示的时候,总是出现这个报错。百度查了半天,终于定位到原因了,解决方法记录一下。

Mr_LiuP的博客 718

微信小程序开发使用echarts报错Cannot read propertygetAttributeof undefined

我在小程序圈中的区域渲染echarts图标报错了,报错提示Cannot read property 'getAttribute' of undefined

晚风的博客 2097

项目中报Cannot read propertygetAttributeof undefined

项目中用到了echarts图表 每次切换路由的时候,控制台就会报一堆错误Cannot read property 'getAttribute' of undefine 这是在火狐浏览器的报错: 经验证,发现是设置了图表自适应导致的, 有多个图表,然后使用是addEventListener来进行图表自适应,但是在离开当前页的时候,没有清除,就导致了上面的报错 了解到原因后,当离开页面的时候,进行清除就可以了 顺便,...

eliodadada的博客 890

76.解决Vue引用echarts报错Cannot read propertygetAttributeof undefined

记录一下 防止下次遗忘: vue使用echarts报错TypeError: Cannot read propertygetAttributeof undefined_weixin_40624809的博客-CSDN博客问题情况自定义一个名为change的函数,函数里面是echarts的渲染代码在created里面调用change,报错:TypeError: Cannot read propertygetAttributeof undefined解决方案在mounted里面调用,或者在crea

银河与猫的博客 642

在element-ui的dialog弹框中使用echarts报错,不能出现图表TypeError: Cannot read propertygetAttributeof undefined

TypeError: Cannot read property 'getAttribute' of undefined问题描述分析原因解决办法 问题描述 最近在写一个vue项目,用的是element-ui框架,其中一个业务需求需要点击之后弹出一个dialog框,然后在这个框里进行渲染绑定的echarts。操作步骤没问题,和以往的操作一样,先是安装echarts使用 npm install echarts@4.8.0 --save 然后再main.js文件中引入并挂载到全局中 // 引入echarts im

丑小鸭变黑天鹅的博客 2471

props传值遇Cannot read property getAttribute of undefined异常

今有一个echarts 图标的子组件使用watch 监听接受父组件传入的data,而在父组件页面再次根据日期筛选数据,重新传入子组件进行图表重绘时老实会提示报错 vue.runtime.esm.js?6e6d:619 [Vue warn]: Error in callback for watcher "chartData": "TypeError: Cannot read property 'getAttribute' of undefined" found in 原来是异步加载数据切换的锅,.

奔跑的痕迹的博客 1029
上一篇: Vue实现播放视频点击截图并上传
下一篇: vue通过v-clipboard实现复制功能
535366
博客等级 码龄5年 16粉丝 · 31原创
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值