Browse Source

fix autocomplete suggestions show

baiyaaaaa 8 years ago
parent
commit
d8610aaa54
1 changed files with 4 additions and 0 deletions
  1. 4 0
      packages/autocomplete/src/autocomplete.vue

+ 4 - 0
packages/autocomplete/src/autocomplete.vue

@@ -98,6 +98,10 @@
       },
       },
       handleChange(value) {
       handleChange(value) {
         this.$emit('input', value);
         this.$emit('input', value);
+        if (!this.triggerOnFocus && !value) {
+          this.suggestions = [];
+          return;
+        }
         this.getData(value);
         this.getData(value);
       },
       },
       handleFocus() {
       handleFocus() {