Skip to content

Commit

Permalink
fix(component): when you clear the elements, the selected element is …
Browse files Browse the repository at this point in the history
…not cleared

re #42
  • Loading branch information
Ilya authored and Ilya committed Mar 17, 2019
1 parent 183b650 commit b184378
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/component.vue
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,11 @@ export default {
},
// ставит выбраный элемент по значению
setSelectedItemByValue () {
if (!this.items.length) return
if (!this.items.length) {
this.selectedItem = null
return
}
this.selectedItem = this.itemsComputed.find(i => {
// TODO вынести получение this.value в computed (оно только в этом методе пока)
Expand Down

0 comments on commit b184378

Please sign in to comment.