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

Merge pull request #3219 from thomasyonug/dev

cascader:bug fix #3191. when menuIndex = 0 edge case
cinwell.li 8 жил өмнө
parent
commit
cdc482c0c4

+ 4 - 2
packages/cascader/src/menu.vue

@@ -73,8 +73,10 @@
       select(item, menuIndex) {
         if (item.__IS__FLAT__OPTIONS) {
           this.activeValue = item.value;
-        } else {
+        } else if (menuIndex) {
           this.activeValue.splice(menuIndex, this.activeValue.length - 1, item.value);
+        } else {
+          this.activeValue = [item.value];
         }
         this.$emit('pick', this.activeValue);
       },
@@ -168,4 +170,4 @@
       );
     }
   };
-</script>
+</script>