Recently, I've been struggling to retrieve the selected items-per-page on a Vuetify data-table due to some recent changes. I came across this helpful example: How to set initial 'rows per page' value in Vuetify DataTable component?
Here is the code snippet that was recommended:
<v-data-table
:headers="headers"
:items="equipment"
class="elevation-1"
:rows-per-page-items="[15, 30, 50, 100]"
:pagination.sync="pagination">
And this part related to the data function:
data() {
return {
pagination: {
rowsPerPage: 30
}, ...
}
}
However, when attempting to access the currently-selected rowsPerPage
, an error message appeared stating:
[BREAKING] 'pagination' has been removed, use 'options' instead. For more information, see the upgrade guide https://github.com/vuetifyjs/vuetify/releases/tag/v2.0.0#user-content-upgrade-guide
I went through the upgrade guide but found minimal information regarding footer control of pagination or how to sync the selected rows-per-page now. I experimented with using options
and examined the table code here:
Unfortunately, it remains unclear how to fetch the selected itemsPerPage, and the options
property does not seem to update reactively. If anyone knows the current method for achieving pagination sync, your insights would be greatly appreciated.