This commit is contained in:
2025-05-10 20:17:10 +08:00
parent 734fc7d083
commit 805cbac1ff
5 changed files with 7 additions and 5 deletions

View File

@@ -98,7 +98,7 @@ async function listComments() {
onMounted(listComments)
watch(() => [query.page, query.limit], listComments)
watchDebounced(() => [query.problem], listComments, {
watchDebounced(() => query.problem, listComments, {
debounce: 500,
maxWait: 1000,
})

View File

@@ -35,7 +35,7 @@ async function addProblem() {
<template>
<n-popconfirm :show-icon="false" @positive-click="addProblem">
<template #trigger>
<n-button secondary size="small" type="primary">+</n-button>
<n-button secondary size="small" type="primary">添加</n-button>
</template>
<n-flex vertical>
<span>请输入在这场比赛中的显示编号</span>

View File

@@ -58,7 +58,8 @@ watch(
if (value) getList()
},
)
watch(query, getList, { deep: true })
watch(() => [query.limit, query.page], getList)
watchDebounced(() => query.keyword, getList, { debounce: 500, maxWait: 1000 })
</script>
<template>
<n-modal
@@ -72,6 +73,7 @@ watch(query, getList, { deep: true })
<n-input
class="search"
v-model:value="query.keyword"
clearable
placeholder="搜索标题或编号"
/>
<n-data-table striped :columns="columns" :data="problems" />

View File

@@ -115,7 +115,7 @@ watch(
},
)
watchDebounced(
() => [query.keyword],
() => query.keyword,
() => {
query.page = 1
routerPush()

View File

@@ -118,7 +118,7 @@ watch(
},
)
watchDebounced(
() => [query.keyword],
() => query.keyword,
() => {
query.page = 1
routerPush()