Browse Source

搜索关键词大小写

visuddhinanda 1 year ago
parent
commit
c86ead1f12
1 changed files with 1 additions and 1 deletions
  1. 1 1
      dashboard/src/components/term/GrammarBook.tsx

+ 1 - 1
dashboard/src/components/term/GrammarBook.tsx

@@ -129,7 +129,7 @@ const GrammarBookWidget = () => {
                 let weight = 0;
                 let weight = 0;
                 const wordBegin = item.word
                 const wordBegin = item.word
                   .toLocaleLowerCase()
                   .toLocaleLowerCase()
-                  .indexOf(keyWord);
+                  .indexOf(keyWord.toLocaleLowerCase());
                 if (wordBegin >= 0) {
                 if (wordBegin >= 0) {
                   weight += (1 / (wordBegin + 1)) * 1000;
                   weight += (1 / (wordBegin + 1)) * 1000;
                   const wordRemain =
                   const wordRemain =