减少嵌套

pull/3219/head
thomasyonug 2017-03-05 22:43:50 +08:00
parent cadcd91968
commit cbf3a9e1f6
1 changed files with 3 additions and 5 deletions

View File

@ -73,13 +73,11 @@
select(item, menuIndex) { select(item, menuIndex) {
if (item.__IS__FLAT__OPTIONS) { if (item.__IS__FLAT__OPTIONS) {
this.activeValue = item.value; this.activeValue = item.value;
} else { } else if (menuIndex) {
if (menuIndex) {
this.activeValue.splice(menuIndex, this.activeValue.length - 1, item.value); this.activeValue.splice(menuIndex, this.activeValue.length - 1, item.value);
} else { } else {
this.activeValue = [item.value]; this.activeValue = [item.value];
} }
}
this.$emit('pick', this.activeValue); this.$emit('pick', this.activeValue);
}, },
handleMenuLeave() { handleMenuLeave() {