Browse Source

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

yuwenjun1997 2 years ago
parent
commit
1dcca6ec49
1 changed files with 1 additions and 1 deletions
  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>')
         },
 
         // 获取文章列表