Implementation of element-puls paging function

element-puls has a paging component, here will teach you how to connect paging with the backend interface.

 

 Regarding the paging component marked above, explain the parameters and business used by the component, without further ado, look at the code

 1,: current-page, which is the current page, this binds a value, when we switch the page number, the bound value state.papenum changes accordingly.

2,: page-sizes, followed by an array, each item in the array represents that we can fix the data that can be selected on the page, the current page can only choose 10, 15, 20, 25 pages to display

3,: page-size, how many pieces of data are displayed in the current list

4,: total, how many pieces of data there are in total, and the backend will generally return

5. @size-chanse, execute when switching how many pieces of data are displayed on the current page, handlesizechange is a function that requests list data, when switching how many pieces of data are displayed, re-request the list,

6. @current-change, execute the function inside when the number of pages is switched, re-execute the list request in it, and re-acquire the data.

 After mastering these values, the basic list paging function can be realized.

The parameters here indicate that the current is the first page, and no page displays 10 pieces of data. You can compare the parameters here with the parameters bound to the component to understand how to use the paging component of element-puls

 

Guess you like

Origin blog.csdn.net/m0_58002043/article/details/130831519