Reencapsulation of elementUI (vue-admin-beautiful) page turning component

        Recently, when using vue-admin-beautiful as the background system, I found that the page turning component is used very frequently. Although it has been encapsulated internally, it has to reuse a lot of code to different pages every time, so it is simply encapsulated twice. (Put it in a file, just import it directly when you need to use pagination), let's not talk about the code.

*** (Screenshot of the parent component code is as follows)

1. In step ①, directly introduce the encapsulated page turning component (pages) in the parent component, and receive the parameter object queryForm that needs to be passed to turn the page.

2. Steps ② and ③ introduce child components in the parent component.

3. Step 4 needs to initialize the parameter (queryForm) passed in the interface in the parent component.

***Subcomponent code (screenshot below)

1. The props in the child component need to receive the parameters passed by the parent component,

2. You need to fill in the appropriate interface field in the corresponding position in ①

3. Write two methods to control page turning in methods (note: the getlist() method must be the same as the parent component’s method of obtaining page data, and is used to call data to refresh the page after the page is turned)

 

Guess you like

Origin blog.csdn.net/weixin_44191318/article/details/120177366