首页 > 解决方案 > replaceAll 在 Cordova 中不起作用

问题描述

我用 React JS 编写了应用程序。现在我想添加 Cordova,但我在生产构建时遇到问题,因为我收到错误:replaceAll is not function

有人知道我该如何解决?

标签: reactjscordova

解决方案


replaceAll 功能进来了August 2020,并不是每个引擎都支持它,所以请使用它regex来实现你的目标。

正则表达式:str =str.replace(/string/g, '');

caniuse:https ://caniuse.com/?search=replaceall


推荐阅读