解决过滤清理的问题
This commit is contained in:
parent
9873d293f0
commit
9b67af6323
|
|
@ -58,6 +58,8 @@ const fetchArticles = async () => {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 监听分页变化
|
||||
watch(page, () => {
|
||||
fetchArticles()
|
||||
|
|
@ -66,8 +68,9 @@ watch(page, () => {
|
|||
})
|
||||
|
||||
// 监听查询参数变化
|
||||
watch(() => route.query.code, (newCode) => {
|
||||
if (!newCode && newCode !== code.value) {
|
||||
watch(() => route.query.code, (newCode, oldCode) => {
|
||||
// 当 code 参数发生变化时(包括从有值变为无值,或从一个值变为另一个值)
|
||||
if (newCode !== oldCode) {
|
||||
page.value = 1
|
||||
fetchArticles()
|
||||
}
|
||||
|
|
@ -123,11 +126,14 @@ onMounted(() => {
|
|||
root:'group',
|
||||
container: 'relative grid lg:grid-cols-[1fr_4fr] gap-8 p-6',
|
||||
}"
|
||||
class="hover:shadow-2xl hover:scale-105 hover:translate-x-8"
|
||||
class="hover:shadow-2xl hover:scale-105 hover:translate-x-8 [--spotlight-size:188px]"
|
||||
orientation="horizontal"
|
||||
reverse
|
||||
spotlight
|
||||
spotlight-color="primary"
|
||||
highlight
|
||||
highlight-color="primary"
|
||||
|
||||
>
|
||||
<!-- 默认图片占位 -->
|
||||
<div class="object-cover aspect-[4/3] w-full bg-gradient-to-br from-blue-100 to-blue-200 flex items-center justify-center rounded-lg">
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user