reactjs - replaceAll 在 Cordova 中不起作用
问题描述
我用 React JS 编写了应用程序。现在我想添加 Cordova,但我在生产构建时遇到问题,因为我收到错误:replaceAll is not function
有人知道我该如何解决?
解决方案
replaceAll 功能进来了August 2020
,并不是每个引擎都支持它,所以请使用它regex
来实现你的目标。
正则表达式:str =str.replace(/string/g, '');
推荐阅读
- javascript - 如何将正文内容分成两半并使用纯 Javascript 在中间插入 html
- apache-kafka - 使用 kafka 连接的 CSV 数据流
- python - 有没有更好的方法来优化这个战舰“射击”功能?
- dart - 如何使用 webdev build 构建两个版本?
- react-native - 更改按钮颜色 ui 小猫反应原生
- eclipse - 在 xtend eclipse 中创建新类时出错
- vue.js - axios POST请求在数据库中正确保存数据后抛出500错误
- c++ - QVector (3D) [] 运算符在 3 级 for 循环中不一致
- python-3.x - print(*a) 中 * 的用途是什么,其中 'a' 是 python 中的列表
- android - 通过 adb pull 接收今天的文件