use default props
Some checks failed
Deploy / deploy (build, debian, 22, /root/OJDeploy/data/clientnext) (push) Has been cancelled
Deploy / deploy (build:staging, school, 8822, /root/OJ/data/dist) (push) Has been cancelled

This commit is contained in:
2026-06-06 05:49:02 -06:00
parent 31d7f4d274
commit 4b05086ba1
13 changed files with 63 additions and 80 deletions

View File

@@ -7,17 +7,14 @@ interface Props {
page: number
}
const props = withDefaults(defineProps<Props>(), {
limit: 10,
page: 1,
})
const { total, limit: initialLimit = 10, page: initialPage = 1 } = defineProps<Props>()
const emit = defineEmits(["update:limit", "update:page"])
const { isDesktop } = useBreakpoints()
const limit = ref(props.limit)
const page = ref(props.page)
const limit = ref(initialLimit)
const page = ref(initialPage)
const sizes = [10, 30, 50]
watch(limit, () => emit("update:limit", limit))
@@ -26,9 +23,9 @@ watch(page, () => emit("update:page", page))
<template>
<n-pagination
v-if="props.total"
v-if="total"
class="right margin"
:item-count="props.total"
:item-count="total"
v-model:page="page"
v-model:page-size="limit"
:page-sizes="sizes"