Explorar o código

文章列表浏览器兼容性修改

yuwenjun1997 %!s(int64=2) %!d(string=hai) anos
pai
achega
1dcca6ec49
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/main/resources/static/js/article/list.js

+ 1 - 1
src/main/resources/static/js/article/list.js

@@ -144,7 +144,7 @@ var articleList = new Vue({
 
         // 高亮关键词
         highlightKeyword: function(str){
-            return str.replaceAll(this.keyword, '<span style="color: #E15616">'+ this.keyword +'</span>')
+            return str.replace(new RegExp(this.keyword, 'g'), '<span style="color: #E15616">'+ this.keyword +'</span>')
         },
 
         // 获取文章列表