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

Three ways to configure Nginx virtual hosts (based on domain names)

Nginx supports three ways to configure virtual ho...

About CSS floating and canceling floating

Definition of Float Sets the element out of the n...

How to use binlog for data recovery in MySQL

Preface Recently, a data was operated incorrectly...

Getting Started Guide to Converting Vue to React

Table of contents design Component Communication ...

Detailed explanation of Docker daemon security configuration items

Table of contents 1. Test environment 1.1 Install...

Example of implementing skeleton screen with Vue

Table of contents Skeleton screen use Vue archite...

Vue implements the countdown component for second kills

This article shares the specific code of Vue to i...

40 CSS/JS style and functional technical processing

1- Styling dropdown select boxes - Modify the dro...

Introduction to installing JDK under Linux, including uninstalling OpenJDK

1. View openjdk rpm -qa|grep jdk 2. Delete openjd...

Detailed steps for installing nodejs environment and path configuration in Linux

There are two ways to install nodejs in linux. On...