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 iliyaZelenko committed Mar 17, 2019
1 parent db40c68 commit 381ddcd
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 @@ -298,7 +298,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 381ddcd

Please sign in to comment.