Compare commits
2 Commits
03e264dbf3
...
cfdcdb0fbb
| Author | SHA1 | Date |
|---|---|---|
|
|
cfdcdb0fbb | |
|
|
4f92d19530 |
|
|
@ -20,18 +20,21 @@ export default OakComponent({
|
|||
},
|
||||
listeners: {
|
||||
oakPagination(prev, next) {
|
||||
let newTotal2 = 0;
|
||||
if (prev.oakPagination?.total !== next.oakPagination?.total) {
|
||||
const { total } = next.oakPagination || {};
|
||||
if (total) {
|
||||
this.setState({ newTotal: total });
|
||||
newTotal2 = total;
|
||||
}
|
||||
}
|
||||
if (prev.oakPagination?.currentPage !== next.oakPagination?.currentPage) {
|
||||
const { pageSize, currentPage, more } = next.oakPagination || {};
|
||||
const { newTotal } = this.state;
|
||||
if (newTotal && pageSize) {
|
||||
if (Math.ceil(newTotal / pageSize) === currentPage && more) {
|
||||
this.setState({ newTotal: newTotal + pageSize });
|
||||
let newTotal3 = newTotal || newTotal2;
|
||||
if (newTotal3 && pageSize) {
|
||||
if (Math.ceil(newTotal3 / pageSize) === currentPage && more) {
|
||||
this.setState({ newTotal: newTotal3 + pageSize });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue