V
V
Vladimir Romantsov2018-07-28 03:50:37
Vue.js
Vladimir Romantsov, 2018-07-28 03:50:37

Why isn't pagination rebuilt after changing props?

After receiving the filtered data from the server, there is a need to rebuild the pagination component, but it is not rebuilt. A conditional example of what is needed here .

When changing the number of received records in input, pagination should be rebuilt.
This is either a flaw in the creator of the component, or I'm doing something wrong.
Tell me where to look.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2018-07-28
@romancov_vladimir

This is either a defect of the component creator or...

Probably, after all, a flaw - I looked at the component code, where copies of the parameters are placed in data, and parameter changes are not tracked.
What can be done, well, besides finding a better component? Alternatively, you can set a key depending on the value of records - then changing the latter will lead to the creation of a new instance of the component:
<pagination
  :key="records"
  ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question