瀏覽代碼

搜索值trim

zhangxc 5 年之前
父節點
當前提交
821dbc0535
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      src/js/index.js
  2. 1 1
      src/js/knowledgeTree.js

+ 1 - 1
src/js/index.js

@@ -92,7 +92,7 @@ $('.radioItem').click(function(e){
 //搜索
 $('#searchBtn').click(function(e){
     e.stopPropagation()
-    const val = $('#searchInp').val()
+    const val = $('#searchInp').val().trim()
     if(val){
         const clientHei = $(window).height()
         const contentHei = clientHei - 80

+ 1 - 1
src/js/knowledgeTree.js

@@ -89,7 +89,7 @@ $('.radioItem').click(function(e){
 //搜索
 $('#searchBtn').click(function(e){
     e.stopPropagation()
-    const val = $('#searchInp').val()
+    const val = $('#searchInp').val().trim()
     if(val){
         const clientHei = $(window).height()
         const contentHei = clientHei - 80