Multiple child components of vue share a parent component property

In the

vue project, there is a pager in the parent component, which is used by several different child components under the parent component. I passed the page number through props and sent the request by listening for the page number to change. The function can be implemented in each sub-component. But now there is a problem is that the number of pages currently selected by the pager is the same in each subcomponent. How can I save different page numbers for each subcomponent?

(all I can think of is to add a pager in the sub-component separately. If it is not reused, it will not interfere with each other, but I think this is the stupidest way. Ask the boss for advice.)

Mar.05,2021

have you solved this problem? I have the same problem, and I don't know how to solve it

Menu