luolei 4 سال پیش
والد
کامیت
eac3e83f45
1فایلهای تغییر یافته به همراه7 افزوده شده و 2 حذف شده
  1. 7 2
      src/components/basicKnow/SearchList.vue

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

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