fix
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-08-05 06:46:44 -06:00
parent 344e9734b6
commit ea691834b0

View File

@@ -21,8 +21,20 @@ const limit = ref(initialLimit)
const page = ref(initialPage) const page = ref(initialPage)
const sizes = [10, 30, 50] const sizes = [10, 30, 50]
watch(limit, () => emit("update:limit", limit)) // 必须 emit 数值emit ref 对象时,父组件用普通 ref 接会拿不到数字,
watch(page, () => emit("update:page", page)) // 而且每次 emit 的都是同一个对象,父组件那边察觉不到变化
watch(limit, (value) => emit("update:limit", value))
watch(page, (value) => emit("update:page", value))
// 父组件改页码 / 每页条数(比如换搜索条件后重置到第一页)时同步回来
watch(
() => initialLimit,
(value) => (limit.value = value),
)
watch(
() => initialPage,
(value) => (page.value = value),
)
</script> </script>
<template> <template>