解决 pdf.js 出现 TypeError: key.split(...).at is not a function 报错问题

问题

使用pdf.js v2版本部分机型出现 TypeError: key.split(…).at is not a function 报错

解决

参考 https://github.com/wojtekmaj/react-pdf/issues/1465

方式一(推荐)
 import 'core-js/features/array/at';
方式二 (解决了部分机型浏览器问题)
  if (!Array.prototype.at) {
    Array.prototype.at = function (index) {
      if (index < 0) {
        index = this.length + index;
      }
      if (index >= 0 && index < this.length) {
        return this[index];
      }
      return undefined;
    };
  }

相关推荐

  1. 解决子组件没有渲染完出现

    2024-06-15 15:58:02       54 阅读
  2. ubuntu 修改系统时间,解决更新软件问题

    2024-06-15 15:58:02       72 阅读
  3. 解决 nginx 504 Gateway Time-out问题

    2024-06-15 15:58:02       65 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-06-15 15:58:02       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-06-15 15:58:02       106 阅读
  3. 在Django里面运行非项目文件

    2024-06-15 15:58:02       87 阅读
  4. Python语言-面向对象

    2024-06-15 15:58:02       96 阅读

热门阅读

  1. C++ 字符串处理5-手机号邮箱如何脱敏处理

    2024-06-15 15:58:02       34 阅读
  2. MongoDB 正则表达式

    2024-06-15 15:58:02       27 阅读
  3. C#中数组ProtoBuf使用问题

    2024-06-15 15:58:02       27 阅读
  4. js字符串域名把域名前缀剪切掉

    2024-06-15 15:58:02       20 阅读
  5. Html_Css问答集(6)

    2024-06-15 15:58:02       27 阅读
  6. python的random模块三choices和shuffle()

    2024-06-15 15:58:02       28 阅读
  7. 表的删除与更新

    2024-06-15 15:58:02       31 阅读
  8. SQL Auto Increment

    2024-06-15 15:58:02       19 阅读
  9. select简单查询

    2024-06-15 15:58:02       29 阅读