luolei 4 years atrás
parent
commit
eac3e83f45
1 changed files with 7 additions and 2 deletions
  1. 7 2
      src/components/basicKnow/SearchList.vue

+ 7 - 2
src/components/basicKnow/SearchList.vue

@@ -21,13 +21,13 @@
 </template>
 </template>
 <script>
 <script>
 import api from '@api/knowledgeTree.js';
 import api from '@api/knowledgeTree.js';
-
 export default {
 export default {
   props:['conceptList','addLevel','top','title','placeTxt'],
   props:['conceptList','addLevel','top','title','placeTxt'],
   data(){
   data(){
     return {
     return {
       conceptText: '',
       conceptText: '',
       list: [], //概念列表
       list: [], //概念列表
+      timer:null
     }
     }
   },
   },
   watch:{
   watch:{
@@ -51,7 +51,12 @@ export default {
       // this.$emit('closeSearch')
       // this.$emit('closeSearch')
     },
     },
     searchConcept() {
     searchConcept() {
-      this.$emit('searchConcept',this.conceptText)
+      if(this.timer) {
+        clearTimeout(this.timer)
+      }
+      this.timer = setTimeout(()=>{
+        this.$emit('searchConcept',this.conceptText)
+      },300)
     },
     },
   }
   }
 }
 }