Skip to content

fix(table): Emit v-model input event only when computedItems changes (closes #2231) #2254

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 8, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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