Skip to content

Commit

Permalink
fix(table): Emit v-model input event only when computedItems changes (c…
Browse files Browse the repository at this point in the history
…loses #2231) (#2254)
  • Loading branch information
tmorehouse authored Dec 8, 2018
1 parent c0a68d5 commit f0fb9af
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/table/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,10 @@ export default {
this.$emit('update:busy', newVal)
}
},
// Watch for changes on computedItems and update the v-model
computedItems (newVal, OldVal) {
this.$emit('input', newVal)
},
// Watch for changes to the filter criteria and filtered items vs localItems).
// And set visual state and emit events as required
filteredCheck ({ filteredItems, localItems, localFilter }) {
Expand Down Expand Up @@ -1034,8 +1038,6 @@ export default {
// Grab the current page of data (which may be past filtered items limit)
items = items.slice((currentPage - 1) * perPage, currentPage * perPage)
}
// update the v-model view
this.$emit('input', items)
// Return the items to display in the table
return items
},
Expand Down

0 comments on commit f0fb9af

Please sign in to comment.