Procházet zdrojové kódy

replaceAll兼容低版本浏览器

liling před 1 rokem
rodič
revize
829d3a945b
1 změnil soubory, kde provedl 7 přidání a 0 odebrání
  1. 7 0
      src/main.js

+ 7 - 0
src/main.js

@@ -108,6 +108,13 @@ app.use(ElementPlus, {
     size: Cookies.get('size') || 'default'
 })
 app.mount('#app')
+if ("undefined"==typeof(String.prototype.replaceAll)) {
+    //replaceAll兼容低版本浏览器
+    String.prototype.replaceAll=function(s1,s2){
+        var g1=new RegExp(s1,"g")
+        return this.replace(g1,s2)
+    }
+}
 window.localStorage.removeItem('noreadlist')
 window.localStorage.removeItem('inChat')
 //禁止复制