首页 > 其他分享 >element-plus 报错 ResizeObserver loop limit exceeded 解决

element-plus 报错 ResizeObserver loop limit exceeded 解决

时间:2023-11-28 17:23:55浏览次数:33  
标签:let timer element callback limit exceeded ResizeObserver 报错

解决方案代码如下:

const debounce = (fn, delay) => {
  let timer = null;
  return function () {
    let context = this;
    let args = arguments;
    clearTimeout(timer);
    timer = setTimeout(function () {
      fn.apply(context, args);
    }, delay);
  }
}

const _ResizeObserver = window.ResizeObserver;
window.ResizeObserver = class ResizeObserver extends _ResizeObserver{
  constructor(callback) {
    callback = debounce(callback, 20);
    super(callback);
  }
}

这个写在main.js或者app.vue里面,在出现报错问题页面之前的页面就行。

标签:let,timer,element,callback,limit,exceeded,ResizeObserver,报错
From: https://www.cnblogs.com/echohye/p/17862450.html

相关文章

  • elementUI + Spring上传文件
    elementUI+Spring上传文件表单文件上传【elementUI+Spring报错解决方案】Requiredrequestpart‘***‘isnotpresent表单上传文件时需要去除@RequestBody前端文件上传doApprove(){const_this=this//创建表单对象letformData=newForm......
  • mysql 报错which is not functionally dependent on columns in GROUP BY clause; thi
    Expression#2ofSELECTlistisnotinGROUPBYclauseandcontainsnonaggregatedcolumn'd.Id'whichisnotfunctionallydependentoncolumnsinGROUPBYclause;thisisincompatiblewithsql_mode=only_full_group_bywindow系统中,服务中找到mysql服务"......
  • python中pip下载慢或报错的解决方法
    一:问题python的pip在安装包时,有时会报错超时,排除包名写错的原因,一般这种问题是因为网络下载过慢,导致超时 二:解决方案我们可以设置pip镜像源下载,能够提升pip下载速度,解决报错问题具体操作是把全局的镜像地址设置成阿里云服务:pipconfigsetglobal.index-urlhttps://mirror......
  • @SpringbootTest报错 javax.websocket.server.ServerContainer not availableJ情况解
    在使用springboot单元测试出现:11:11:10.799[main]ERRORo.s.b.SpringApplication-[reportFailure,870]-Applicationrunfailedorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'serverEndpointExporter'definedincla......
  • Make Lexicographically Smallest Array by Swapping Elements
    MakeLexicographicallySmallestArraybySwappingElementsYouaregivena 0-indexed arrayof positive integers nums anda positive integer limit.Inoneoperation,youcanchooseanytwoindices i and j andswap nums[i] and nums[j] if |nums......
  • 关于python中pip安装库过程中报错的解决办法
    晚上使用flask框架搭建web服务,启动后报错如下:WARNING:Thisisadevelopmentserver.Donotuseitinaproductiondeployment.UseaproductionWSGIserverinstead. 经过搜索大法,发现是因为在开发环境中,Flask应用程序是使用内置的服务器(如SimpleServer或Lighttpd)运......
  • HTMLElement: offsetParent property
    HTMLElement:offsetParentpropertyTheHTMLElement.offsetParentread-onlypropertyreturnsareferencetotheelementwhichistheclosest(nearestinthecontainmenthierarchy)positionedancestorelement.Apositionedancestoriseither:anelementwit......
  • JAVA替换replaceAll方法报错:Illegal group reference
     Exceptioninthread"main"java.lang.IllegalArgumentException:Illegalgroupreference atjava.util.regex.Matcher.appendReplacement(Matcher.java:857) atjava.util.regex.Matcher.replaceAll(Matcher.java:955) atjava.lang.String.replaceAll(String......
  • yarn的安装与禁止运行脚本报错
    一、yarn1.安装与卸载npminstall-gyarnnpmuninstallyarn-g//yarn卸载2.npm存在的一些不足:npminstall下载速度慢,即使是重新install时速度依旧慢同一个项目,安装的无法保持一致性。原因是因为package.json文件中版本号的特点导致在安装的时候代表不同的含义。使用npm......
  • WSL安装软件报错/sbin/ldconfig.real: /usr/lib/wsl/lib/libcuda.so.1 is not a symbo
    原因/usr/lib/wsl/lib/目录下都是文件而不是链接,且该目录只读,需要在其他目录操作解决cd/usr/lib/wslsudomkdirlib2sudoln-slib/*lib2更改wsl配置文件sudovim/etc/ld.so.conf.d/ld.wsl.conf将/usr/lib/wsl/lib改为/usr/lib/wsl/lib2测试修改是否生效sudo ldco......