This article example shares the specific code of vue+Element to achieve the paging effect for your reference. The specific content is as follows The general style is that the card contains lists and paging Here is the code directly <el-card> <!-- User List Area --> <el-table :data="rightsList.slice((currentPage-1)*pagesize,currentPage*pagesize)" border stripe> <el-table-column label="#" type="index"></el-table-column> <el-table-column label="Authorization Name" prop="authName"></el-table-column> </el-table> <!--Paging area--> <el-pagination @size-change="size_change" //Triggered when pageSize changes @current-change="current_change" //Triggered when currentPage changes:current-page="currentPage" //Current page number:page-sizes="[10,20,30]" //Option setting for the selector of the number of items displayed per page:page-size="pagesize" //Number of items displayed per page layout="total, sizes, prev, pager, next, jumper" //Component layout:total="rightsList.length //Total number of items"> </el-pagination> </el-card> Then define the data data() { return { rightsList:[], //list data total:0, //total number of entries pagesize:10, //number of entries displayed per page currentPage:1, //current page number} }, Listening for change events methods:{ //Listen for pagesize change events size_change(newSize){ this.pagesize = newSize } //Listen for page value changes current_change(newPage){ this.currentPage = newPage }, } The effect is as shown The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Vue+Router+Element to implement a simple navigation bar
>>: Implementation of docker-compose deployment of zk+kafka+storm cluster
Nginx supports three ways to configure virtual ho...
Definition of Float Sets the element out of the n...
Preface Recently, a data was operated incorrectly...
Table of contents design Component Communication ...
MySQL 8.0.22 installation and configuration metho...
Table of contents 1. Test environment 1.1 Install...
Table of contents Skeleton screen use Vue archite...
The following problem occurred when installing my...
This article shares the specific code of Vue to i...
1- Styling dropdown select boxes - Modify the dro...
1. View openjdk rpm -qa|grep jdk 2. Delete openjd...
Request logic Front-end --> Request nginx via ...
There are two ways to install nodejs in linux. On...
GitHub address: https://github.com/dmhsq/dmhsq-my...
Today I will introduce how to enable the Linux su...