Vue backend management system implementation of paging function example

Vue backend management system implementation of paging function example

This article mainly introduces the implementation of the paging function of the Vue background management system, and shares it with you, as follows:

Effect picture:

Functional description:

  • Display the total number of data
  • You can choose the number of items to display per day
  • Click on the page number to jump to the specified page
  • Enter the page number to jump to the specified page

1. Function Implementation

1.1 Structure

        <!-- Pagination -->
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="queryInfo.pagenum"
          :page-sizes="[2, 5, 10, 15]"
          :page-size="queryInfo.pagesize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
        >
        </el-pagination>

1.2 Logic

    data() {
      return {
        //Request parameter queryInfo: {
          type: 3,
          //Current page number pagenum: 1,
          //Specify the number of pages displayed pagesize: 5,
        },
        goodsList: [],
        //Total data total: 0,
      }
    }
 
  methods: {
      //Get product classification data async getGoodsCate() {
        const { data: res } = await this.$http.get("categories", {
          params: this.queryInfo,
        })
        if (res.meta.status !== 200) {
          this.$message.error("Failed to get parameters")
        }
        this.total = res.data.total
        this.goodsList = res.data.result
        //console.log(this.goodsList)
      },
      //Monitor the number of entries per page handleSizeChange(pagesize) {
        // console.log(`${val} items per page`)
        this.queryInfo.pagesize = pagesize
        this.getGoodsCate()
      },
      //Monitor the current page number handleCurrentChange(pageNum) {
        this.queryInfo.pagenum = pageNum
        this.getGoodsCate()
      },
    },

1.3 Parameter Description

1.4 Effect Demonstration

This is the end of this article about the Vue backend management system's implementation of the paging function example. For more relevant Vue paging content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Vue3 encapsulates its own paging component
  • Vue+Element realizes paging effect
  • Vue implements paging function
  • Vue project realizes paging effect
  • Vue+Element-U realizes paging display effect
  • vue+Element-ui front-end realizes paging effect

<<:  Detailed explanation of commonly used styles in CSS3 [Basic text and font styles]

>>:  How to point the target link of a tag to iframe

Recommend

Detailed explanation of the process of installing MySQL on Ubuntu 18.04.4

Let's take a look at the process of installin...

Detailed explanation of Docker Swarm service orchestration commands

1. Introduction Docker has an orchestration tool ...

Guide to Efficient Use of MySQL Indexes

Preface I believe most people have used MySQL and...

Use CSS to implement special logos or graphics

1. Introduction Since pictures take up a lot of s...

MySQL Installer 8.0.21 installation tutorial with pictures and text

1. Reason I just needed to reinstall MySQL on a n...

React error boundary component processing

This is the content of React 16. It is not the la...

Tutorial diagram of using Jenkins for automated deployment under Windows

Today we will talk about how to use Jenkins+power...

In-depth analysis of MySQL query interception

Table of contents 1. Query Optimization 1. MySQL ...

Detailed explanation of the function and usage of keepAlive component in Vue

Preface During the interview, many interviewers m...

How to process local images dynamically loaded in Vue

Find the problem Today I encountered a problem of...