fix: ページカウントのズレを修正
This commit is contained in:
parent
431e51bb7e
commit
0c9c94ce85
@ -5,7 +5,7 @@ export async function load({params}){
|
|||||||
const postList = await Metas()
|
const postList = await Metas()
|
||||||
|
|
||||||
const posts = postList.slice(pageNo*12, (pageNo+1)*12);
|
const posts = postList.slice(pageNo*12, (pageNo+1)*12);
|
||||||
const lastPage = Math.trunc(postList.length/12);
|
const lastPage = Math.ceil(postList.length/12)-1;
|
||||||
|
|
||||||
return {posts, pageNo, lastPage}
|
return {posts, pageNo, lastPage}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user