Przeglądaj źródła

fix select reset bug

Leopoldthecoder 9 lat temu
rodzic
commit
01e315c9b1
1 zmienionych plików z 3 dodań i 4 usunięć
  1. 3 4
      packages/select/src/select.vue

+ 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();