mirror of
https://github.com/gotson/komga.git
synced 2026-04-22 06:50:51 +02:00
coerce query param
This commit is contained in:
parent
0d66ae528f
commit
f3ea22dcfc
1 changed files with 3 additions and 1 deletions
|
|
@ -11,7 +11,9 @@ import { useRouteQuery } from '@vueuse/router'
|
|||
* The consumer is responsible for updating `pageCount`.
|
||||
*/
|
||||
export function usePagination() {
|
||||
const queryPage = useRouteQuery('page', '1', { transform: Number })
|
||||
const queryPage = useRouteQuery('page', '1', {
|
||||
transform: (input) => Math.abs(Number(input)) || 1,
|
||||
})
|
||||
const page0 = ref(queryPage.value - 1)
|
||||
const page1 = ref(queryPage.value)
|
||||
const pageCount = ref(0)
|
||||
|
|
|
|||
Loading…
Reference in a new issue