首页 > 其他分享 >vue中pdf预览,报错(Cannot read properties of undefined (reading ‘catch‘))解决

vue中pdf预览,报错(Cannot read properties of undefined (reading ‘catch‘))解决

时间:2023-05-18 16:44:48浏览次数:46  
标签:vue return undefined canceling pdfRender 报错 catch pdf

1、在node_modules中找到vue-pdf,src下的pdfjsWrapper.js

if ( pdfRender !== null ) {
   if ( canceling )
       return;
   canceling = true;
   pdfRender.cancel().catch(function(err) {
       emitEvent('error', err);
   });
   return;
}

  修改为

if ( pdfRender !== null ) {
   if ( canceling )
      return;
   canceling = true;
   pdfRender.cancel();
   return;
}

  

标签:vue,return,undefined,canceling,pdfRender,报错,catch,pdf
From: https://www.cnblogs.com/sgdkg/p/17412427.html

相关文章

  • 路由导航报错:NavigationDuplicated: Avoided redundant navigation to current locati
    跳转页面时候,重复点击菜单引起路由重复报错;点击按钮跳转到同一个或当前的路径会报错。为每一个Promise添加一个回调函数this.$router.push({name:'Cats',},()=>{})修改VueRouter原型对象上的push/replace方法在router/index.js文件中添加如下代码//获取原型对......
  • VUE基础
    一、基础vue和jquery一样,是前端的js库在html文件中使用需导入vue.js:<scriptsrc="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>{{xx}}来表示取某个变量xx的值二、vue指令v-model:双向数据绑定用来在input、select、textarea、checkbox、radio等表单控......
  • vue中事件修饰符.prevent.self和.self.prevent有什么区别
    v-on:click.prevent.self:会阻止所有的点击,阻止了自身的默认事件和阻止了子元素事件的向上冒泡。v-on:click.self.prevent:只会阻止对元素自身的点击,阻止了子元素事件的向上冒泡,阻止了子组件冒泡事件的默认事件。在Vue.js中,事件修饰符.prevent用于阻止事件的默认行为,.self用于阻......
  • error Resolve error: @vitejs/plugin-vue requires vue (>=3.2.13) or @vue/compile
    创建Vue3项目时出错error Resolveerror:@vitejs/plugin-vuerequiresvue(>=3.2.13)or@vue/compiler-sfctobepresentinthedependencytree将vue 升级到 [email protected]  版本 执行[email protected] ......
  • Vue框架中,何为渐进式框架?
    我的理解是:vue框架提供了不同层次的特性与功能,在使用过程中丰俭由人,既可以只使用核心特性,又可以使用高级特性及第三方功能。核心:数据驱动(视图的内容随着数据的改变而改变)组件化(可以增加代码的复用性,可维护)无论再怎么灵活,Vue的核心知识在所有这些用例中都是通用的。......
  • Navicat连接本地mysql报错-caching_sha2_password
     查询用户加密方式:selectuser,pluginfromuserwhereuser='root';修改用户加密方式改为mysql_native_password。alteruser'root'@'localhost'identifiedwithmysql_native_passwordby'123123';执行命令flushprivileges使权限配置项立即生效flushp......
  • chatGP问答 - elasticsearch ,这个报错memory locking requested for elasticsearch p
    问:elasticsearch,这个报错memorylockingrequestedforelasticsearchprocessbutmemoryisnotlocked答:是的,我理解你的问题。当你在配置Elasticsearch时,如果遇到"memorylockingrequestedforelasticsearchprocessbutmemoryisnotlocked"错误,这通常表示El......
  • fastapi报错TypeError("'numpy.int64' object is not iterable"解决
     目录1.代码1.1main.py1.2start.sh?bug1------[TypeError("'numpy.int64'objectisnotiterable")bug2------"msg":"valueisnotavaliddict",1.代码1.1main.py?12345678910111213141516171819......
  • vue 环境问题记录
    1.项目初始化报错 npmERRcommandgit--no-replace-objectsls-remotessh://git@github-com/nhn/raphael-git 这一块的报错是需要本地生成的SSHkeys添加到gitHub里面,可以参照如下链接的博主就弄好了。https://blog.csdn.net/weixin_44405693/article/details/1221752732......
  • vue开发技巧
    很有用的Vue开发技巧 1. 路由参数解耦通常在组件中使用路由参数,大多数人会做以下事情。exportdefault{methods:{getParamsId(){returnthis.$route.params.id}}}在组件中使用$route会导致与其相应路由的高度耦合,通过......