As the default Vuetify v-data-table component doesn't have a numbered pagination and select page dropdown built-in, I decided to make my own wrapper component, genericTable.vue
.
Everything is looking the way I want. However, I encounter the following issue:
Note: I want the genericTable component to be a dumb component, meaning it accepts props and emits events to allow them to be dynamic and reusable. As soon as a user selects a page or changes the items per page, an event is emitted from the genericTable component to the parent component.
Sandbox
https://codesandbox.io/s/mutable-frog-rb2v8
Snippet
// genericTable.vue
<genericTable
:page="currentPage"
:pageNumbers="pageNumbers"
:headers="headers"
:items="items"
:totalItems="totalItems"
:pageCount="pageCount"
:itemsPerPage="itemsPerPage"
@update:page="pageUpdated"
@update:itemsPerPage="itemsPerPageUpdated">
</genericTable>