Vue + Element-UI Implementation Paging Effect Instance Code Detailed

When we request a lot of data to the background, and to show it, the requested data may pick up hundreds of data or more, do not want to show in a page, which requires the use of paging functions to complete NS.

1. This is the Vue2.0 + Element-UI implements a paging function. Element-ui is particularly rich, and it provides me with a PAGINATION paging in paging, using PAGINATION to complete the paging function.

vue+Element-ui实现分页效果实例代码详解

  
Data Management User list
// This shows how much data shows a total of Need DATA definition UserList defines an empty number, requested data is stored in this
DATA () {return {CURRENTPAGE: 1, // initial page PAgesize: 10, // Data UserList: []}} per page UserList:
For some data, method processing, the source of data is built by JSON-Server Local data, request data by Vue-Resource,

created () {this.handleUserList ()}, methods: {// initial page CURRENTPAGE, initial number of data per page pagesize data and data handleSizeChange: function (size) {this.pagesize = size; console.log (this.pagesize) // page pull-down display data}, handleCurrentChange: function (currentPage) {this.currentPage = currentPage; console.log (THIS.CURRENTPAGE) / / Click on the first few pages}, handleunerlist () {this. $ http.get (‘http: // localhost: 3000 / userlist’) .then (res => {// This is from the local request Data interface, this.userlist = res. body}}}}}}}}}}}}}}}}}}}}}}}
The above is the functionality required for paging, but also it is encountered in the case. And summarize the convenience to see, you can pay attention to
  You can pay attention to https://github.coM / mrzhlf / vue-admin-system, this case is also perfect, and the function is also increasing  

The above is small. Everyone introduces the Vue + Element-UI implementation of the paging effect instance code, I hope to help everyone. If you have any questions, please leave a message, the small package will reply to everyone. Thank you very much for your support of Tumi Cloud Website!
                    
© Copyright Notice
THE END
Just support it if you like
like0
share
comment Grab the couch

Please log in to comment