How to set initial 'rows per page' value in Vuetify DataTable component?

dreamwalker

I have a page with Vuetify DataTable component (Vuetify 1.5.7) and using default component's pagination. I set the 'Rows per page' select values using the :rows-per-page-items property.

Now I want to set initial value from this rows-per-page-items array (not only the first one!) when entering the page.

Is it possible and how can I do this?

Example code of table is shown below:

<v-data-table
            :headers="headers"
            :items="equipment"
            class="elevation-1"
            :rows-per-page-items='[15, 30, 50, 100]'>
      <template v-slot:items="props">
        <td>{{ props.item.name }}</td>
      </template>
</v-data-table>
stdob--

Use the pagination.sync to control pagination:

<v-data-table
            :headers="headers"
            :items="equipment"
            class="elevation-1"
            :rows-per-page-items="[15, 30, 50, 100]"
            :pagination.sync="pagination">
      <template v-slot:items="props">
        <td>{{ props.item.name }}</td>
      </template>
</v-data-table>
...
data() {
  return {
    pagination: {
      rowsPerPage: 30
    }, ...
  }
}

[ https://jsfiddle.net/95yf1xe8/ ]

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Vuetify datatable Rows per page is not working

Vuetify datatable rows per page dropdown is not showing properly

Vuetify Data table: how to have an automatic number of rows per page (depending on the vertical space filled by the component)?

Vuetify Select Component Initial Value issue

Understand `rows-per-page-items` at Vuetify Data iterators + Data tables, can I set default page?

How to set rows in a DataTable with the same column value?

Set initial vuetify v-select value

How to change `Items per page` text in vuetify?

How to set component property programmatically in Vuetify component

how to set initial value in react?

How to set initial value for formArray?

In Inno Setup, how can I set which component gets an initial focus on "Select Components" page

How to style grouped rows in Vuetify datatable using slots?

Material UI - Remove "Rows per page" in the component TablePagination

How to get sum per page of column in table component and return to main report to display value?

Setting initial value of a Vuetify checkbox

How do I set a variable to value using React-Redux on the initial page load?

Child component does not set the initial value passed from the parent: ReactJS

How to set initial value for primary key in migration?

WPF MVVM how to set initial value of contentcontrol

How to set initial value for select element in AngularJS?

How to set initial value for radautocomplete in nativescript?

how to set initial value to dropdown menu in flutter?

How to set an initial value for an object key?

How to set initial value and auto increment in MySQL?

How to set initial value for read only field

How to set initial value in directive property

How to set initial value for variable in Openresty

How to set the initial value Nil using /: (Not the foldRight)