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:
1. Function Implementation1.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:
|
<<: Detailed explanation of commonly used styles in CSS3 [Basic text and font styles]
>>: How to point the target link of a tag to iframe
This article shares the installation tutorial of ...
Let's take a look at the process of installin...
1. MS SQL SERVER 2005 --1. Clear the log exec(...
1. Introduction Docker has an orchestration tool ...
Preface I believe most people have used MySQL and...
1. Introduction Since pictures take up a lot of s...
Basic Concepts Current read and snapshot read In ...
1. Reason I just needed to reinstall MySQL on a n...
This is the content of React 16. It is not the la...
Today we will talk about how to use Jenkins+power...
Table of contents 1. Query Optimization 1. MySQL ...
Preface In the actual use of the database, we oft...
Preface During the interview, many interviewers m...
Preface <br />In the previous article "...
Find the problem Today I encountered a problem of...