Is it possible to modify v-data-table pagination?
In this v-data-table pagination section(next,previous button).Am trying to give functions to this next and previous pagination button. But i don't know how to modify this pagination section in v-data-table!
Actually am trying to modify v-data-table to connect pagination with back end response. But i don't get it.
<v-data-table :headers="headers" :items="userDetails" :search="search" :items-per-page="perPage"
:pagination.sync="pagination" :server-items-length="totalUsers" class="elevation-1"
>
<template v-slot:[`item.type`]="{ item }">
<div v-if="item.type == 1">
<v-icon>mdi-account-circle</v-icon>
Google User
</div>
<div v-if="item.type == 0">
<v-icon>mdi-account-box</v-icon>
Normal User
</div>
</template>
<template v-slot:[`item.status`]="{ item }">
<div v-if="item.status == 1">
<v-icon style="color:green">mdi-checkbox-blank-circle </v-icon>
Active
</div>
<div v-if="item.status == 0">
<v-icon style="color:red">mdi-checkbox-blank-circle </v-icon>
Inactive
</div>
</template>
<template v-slot:[`item.action`]="{ item }">
<div v-if="item.status == 1">
<v-btn style=" width: 118px;" color="red" class="white--text" v-on:click="Active(item.id)">
De-Activate
</v-btn>
</div>
<div v-if="item.status == 0">
<v-btn style=" width: 118px;" color="green" class="white--text" v-on:click="deActive(item.id)">
Activate</v-btn>
</div>
</template>
</v-data-table>
Script method below
async getUser() {
http.get("/loggedInUser?page=").then((response) => {
console.log(response)
console.log("ee", response.data)
this.userDetails = response.data.users.data
this.totalUsers = response.data.users.total
this.perPage = response.data.users.per_page
console.log("qq", this.totalUsers)
this.userDetailss = this.userDetails.map((item) => item.status);
console.log("1122222", this.userDetailss);
// this.userStatus=response.data.users.data.status
// console.log("dd",this.userStatus)
console.log("ww", this.userDetails);
});
},
I want to add perPage
to an API endpoint ("/loggedInUser?page=") when the pagination button is clicked.