Эх сурвалжийг харах

Merge pull request #128 from Leopoldthecoder/next

fix select reset bug
cinwell.li 9 жил өмнө
parent
commit
275d092dbb

+ 3 - 4
packages/select/src/select.vue

@@ -197,13 +197,12 @@
           });
         }
         if (!this.multiple) {
-          if (val === '') {
-            this.selected = {};
-            this.selectedLabel = '';
-          }
           let option = this.options.filter(option => option.value === val)[0];
           if (option) {
             this.$emit('addOptionToValue', option);
+          } else {
+            this.selected = {};
+            this.selectedLabel = '';
           }
         }
         this.resetHoverIndex();