Browse Source

fix: 修复高亮替换value为空报错的问题

cuiyalong 1 year ago
parent
commit
07d1703f86
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/web/staticres/js/common.js

+ 3 - 0
src/web/staticres/js/common.js

@@ -314,6 +314,9 @@ function keyWordHighlight (value, oldChars, newChar) {
   if(typeof(oldChars) == "undefined" || oldChars == null || typeof(newChar) == "undefined" || newChar == null || newChar == "" || oldChars == '略'){
     return value;
   }
+  if (!value) {
+    return value || ''
+  }
   var array = [];
   if(oldChars instanceof Array){
     array = oldChars.concat();