fix: 페이징 단위 넘기기 버튼 오류 수정
- 다음 단위 없는데도 넘어가는 현상 수정
This commit is contained in:
parent
b5eefeca7e
commit
4eb2497139
@ -138,7 +138,7 @@ export default function Playground() {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
pagePerBlock: 10,
|
||||
totalCount: 501,
|
||||
totalCount: 26,
|
||||
handleChangePage: (page) => {
|
||||
console.log('page', page)
|
||||
},
|
||||
|
||||
@ -31,7 +31,7 @@ export default function QPagination(props) {
|
||||
<button
|
||||
onClick={() => {
|
||||
if (currentPage === totalPages) return
|
||||
handlePage(Math.max(1, pageGroup * pagePerBlock + 1))
|
||||
if (pageGroup * pagePerBlock + 1 <= totalPages) handlePage(Math.max(1, pageGroup * pagePerBlock + 1))
|
||||
}}
|
||||
></button>
|
||||
</li>
|
||||
|
||||
@ -28,6 +28,15 @@ const usePagination = ({ pageNo = 1, pageSize = 10, pagePerBlock = 10, totalCoun
|
||||
return i + startPage
|
||||
})
|
||||
|
||||
// console.log('pageRange', pageRange)
|
||||
// console.log('startPage', startPage)
|
||||
// console.log('endPage', endPage)
|
||||
// console.log('totalPages', totalPages)
|
||||
// console.log('pageGroup', pageGroup)
|
||||
// console.log('pagePerBlock', pagePerBlock)
|
||||
// console.log('currentPage', currentPage)
|
||||
// console.log('pageNo', pageNo)
|
||||
|
||||
return { currentPage, changePage, pageGroup, totalPages, pages, startPage, endPage, pageRange }
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user