Pagination - @input called for each pagination component
See original GitHub issueWhen using two pagination components (e.g. above and below a table) that show the same pagination data, the @input will be called twice.
<b-pagination :total-rows="100" :value="page" :per-page="10" @input="toPage"></b-pagination>
<!-- e.g. table -->
<b-pagination :total-rows="100" :value="page" :per-page="10" @input="toPage"></b-pagination>
In this case toPage
will be called twice when using either one of the pagination components:
Issue Analytics
- State:
- Created 6 years ago
- Comments:17 (11 by maintainers)
Top Results From Across the Web
Pagination | Components - BootstrapVue
<b-pagination> is a custom input component that provides a current page number input control. The value should be bound via v-model in your...
Read more >Pagination - Bootstrap
Pagination is built with list HTML elements so screen readers can announce the number of available links. Use a wrapping <nav> element to...
Read more >A simple guide to Pagination in React | by Kunal Nalawade
Inside the Pagination component, create an array that holds all the page numbers from 1 to nPages. Here are several ways to create...
Read more >React pagination from scratch using Hooks - LogRocket Blog
Create a reusable pagination component from scratch using React Hooks and avoid heavy libraries that may harm your app's performance.
Read more >Building a Pagination Component in Angular | Joshua Colvin
A pagination component can be used to paginate a list of items. In this article, we will code a pagination component in Angular....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Components are self contained, and two pagination components do not know about each other, but in your case they are bound to the same value, so a change in that value will trigger a change on both components, hence each firing the
@input
event whenever the value changes. It would be similar to biding two text inputs to the same value. CHanging the content of one text input would also change the content of the other text input. It is not a bug, as it is the nature of reactivity in Vue.jsThen, use a watcher on your
value
, and if it changes then calltoPage(#)
in your watcher function.