짝수 페이지네이션
This commit is contained in:
@@ -96,7 +96,7 @@
|
||||
const data = await articleService.getArticles({page});
|
||||
const {content, totalPages, pageable} = data;
|
||||
|
||||
this.pages = paginationUtil(page + 1, totalPages);
|
||||
this.pages = paginationUtil(page + 1, totalPages, 4);
|
||||
|
||||
this.articles = content;
|
||||
this.pending = false;
|
||||
|
||||
@@ -15,8 +15,14 @@ export default function (currentPage, totalPage, chapterSize = 5) {
|
||||
} else {
|
||||
const rest = (chapterSize - 1);
|
||||
const halfOfRest = rest / 2;
|
||||
|
||||
start = currentPage - halfOfRest;
|
||||
end = currentPage + halfOfRest;
|
||||
|
||||
if (halfOfRest % 2 !== 0) {
|
||||
start += 0.5;
|
||||
end += 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
const range = [];
|
||||
|
||||
Reference in New Issue
Block a user