Vue+Element realizes paging effect

Vue+Element realizes paging effect

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:
  • How to use vue + element to implement table paging and front-end search
  • Vue+element-ui implements table paging function example
  • Implementation of paging problem of vue + element-ui
  • An example of using vue and element-ui to set table content paging
  • vue+element tabs tab paging effect
  • Vue+ElementUI table realizes table paging
  • vue+elementUI component table realizes front-end paging function
  • vue+Element-ui front-end realizes paging effect
  • Vue imitates element to achieve paging effect
  • Vue+Element-U realizes paging display effect

<<:  Vue+Router+Element to implement a simple navigation bar

>>:  Implementation of docker-compose deployment of zk+kafka+storm cluster

Recommend

The pitfall record of the rubber rebound effect of iOS WeChat H5 page

Business requirements One of the projects I have ...

MySQL 5.7.21 Installer Installation Graphic Tutorial under Windows 10

Install MySQL and keep a note. I don’t know if it...

Mobile Internet Era: Responsive Web Design Has Become a General Trend

We are in an era of rapid development of mobile In...

Analysis and summary of the impact of MySQL transactions on efficiency

1. Database transactions will reduce database per...

A Brief Analysis of Patroni in Docker Containers

Table of contents Create an image File Structure ...

Implementation of Docker to build private warehouse (registry and Harbor)

As more and more Docker images are used, there ne...

Docker network principles and detailed analysis of custom networks

Docker virtualizes a bridge on the host machine. ...

5 things to note when writing React components using hooks

Table of contents 01. Use useState when render is...

HTML page jump code

Save the following code as the default homepage fi...

How to modify the firewall on a Linux server to allow remote access to the port

1. Problem Description For security reasons, the ...

Using Openlayer in Vue to realize loading animation effect

Note: You cannot use scoped animations! ! ! ! via...

Grid systems in web design

Formation of the grid system In 1692, the newly c...

Tutorial on installing MySQL database and using Navicat for MySQL

MySQL is a relational database management system ...

Solve the error of installing VMware Tools on Ubuntu 18.04

1. According to the online tutorial, the installa...