Merge pull request #128 from Leopoldthecoder/next

fix select reset bug
pull/2/head
cinwell.li 2016-08-31 17:12:04 +08:00 committed by GitHub
commit 275d092dbb
1 changed files with 3 additions and 4 deletions

View File

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