Skip to content

Commit f0fb9af

Browse files
authored
fix(table): Emit v-model input event only when computedItems changes (closes #2231) (#2254)
1 parent c0a68d5 commit f0fb9af

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/table/table.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,10 @@ export default {
750750
this.$emit('update:busy', newVal)
751751
}
752752
},
753+
// Watch for changes on computedItems and update the v-model
754+
computedItems (newVal, OldVal) {
755+
this.$emit('input', newVal)
756+
},
753757
// Watch for changes to the filter criteria and filtered items vs localItems).
754758
// And set visual state and emit events as required
755759
filteredCheck ({ filteredItems, localItems, localFilter }) {
@@ -1034,8 +1038,6 @@ export default {
10341038
// Grab the current page of data (which may be past filtered items limit)
10351039
items = items.slice((currentPage - 1) * perPage, currentPage * perPage)
10361040
}
1037-
// update the v-model view
1038-
this.$emit('input', items)
10391041
// Return the items to display in the table
10401042
return items
10411043
},

0 commit comments

Comments
 (0)