There is a problem with the front-end development, 'isInitialized'.Using 'isInitialized' causes the view to update untimely, if not using if(isInitialized) return;Dom initialization can also be a problem, so contradictory,I don't know how to solve?If Flarum has a front-end development zone, please tell me, Thank you very much!
code:
<div><ul id="teamsPages" class="pagination-sm" config={this.pageconfig.bind(this)}></ul></div>
pageconfig(content,isInitialized){
if(isInitialized) return;
let _that = this,
{ stateData,tbody,total,refresh } = _that.props,
pages = this.$("#teamsPages"),
newPage = {},
qty = Math.ceil(total/10);
pages.empty();
pages.removeData("twbs-pagination");
pages.unbind("page");
pages.twbsPagination('destroy');
pages.twbsPagination({
totalPages: qty,
visiblePages: 10,
onPageClick: function (event,page) {
_that.state.data.page = page - 1;
_that.state.page = page - 1;
newPage.page = page - 1;
let newSeendPage = Object.assign({},stateData,newPage);
refresh(newSeendPage);
}
});
}