Parcourir la source

更新 船舶搜索组件最小搜索长度

wzh il y a 4 ans
Parent
commit
a8b82ee92a
1 fichiers modifiés avec 2 ajouts et 3 suppressions
  1. 2 3
      src/components/ShipSearch.vue

+ 2 - 3
src/components/ShipSearch.vue

@@ -14,7 +14,7 @@
 
 <script>
 import { onMounted, ref } from "vue";
-import api from "../apis/fetch";
+import api from "apis/fetch";
 import _ from "lodash";
 export default {
   props: {
@@ -39,9 +39,8 @@ export default {
     let selectStr = ref("");
     const getSelectList = _.debounce(
       async (queryString, cb) => {
-        if (!queryString) return;
+        if (queryString.length < 3) return;
         let res = await api[props.api]({
-          ...props.params,
           term: queryString,
         });
         if (res.data.status == 0) {