Forráskód Böngészése

Select: not clear text when filtering (#12304)

hetech 7 éve
szülő
commit
6f08e941aa
1 módosított fájl, 8 hozzáadás és 2 törlés
  1. 8 2
      packages/select/src/option.vue

+ 8 - 2
packages/select/src/option.vue

@@ -86,8 +86,14 @@
       currentLabel() {
         if (!this.created && !this.select.remote) this.dispatch('ElSelect', 'setSelected');
       },
-      value() {
-        if (!this.created && !this.select.remote) this.dispatch('ElSelect', 'setSelected');
+      value(val, oldVal) {
+        const { remote, valueKey } = this.select;
+        if (!this.created && !remote) {
+          if (valueKey && typeof val === 'object' && typeof oldVal === 'object' && val[valueKey] === oldVal[valueKey]) {
+            return;
+          }
+          this.dispatch('ElSelect', 'setSelected');
+        }
       }
     },