Skip to content

BPagination - initial page count set twice. #6199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Nesuarg opened this issue Dec 15, 2020 · 0 comments · Fixed by #6200
Closed

BPagination - initial page count set twice. #6199

Nesuarg opened this issue Dec 15, 2020 · 0 comments · Fixed by #6200

Comments

@Nesuarg
Copy link

Nesuarg commented Dec 15, 2020

In pagination.js the page count is initial set 2 times in first in created() and again in mounted(). If this is solved an edge case issue, then then comment should be updated?
Note that I didn't find any bugs related to this.

created() {
// Set the initial page count
this.localNumberOfPages = this.numberOfPages
// Set the initial page value
const currentPage = toInteger(this[MODEL_PROP_NAME], 0)
if (currentPage > 0) {
this.currentPage = currentPage
} else {
this.$nextTick(() => {
// If this value parses to `NaN` or a value less than `1`
// trigger an initial emit of `null` if no page specified
this.currentPage = 0
})
}
},
mounted() {
// Set the initial page count
this.localNumberOfPages = this.numberOfPages
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants