feat: 为搜索页添加error监听
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m45s

This commit is contained in:
2025-09-28 16:41:36 +08:00
parent 1ac9c76c3e
commit 1c98921e01

View File

@ -109,7 +109,6 @@
data: sections, data: sections,
pending: loading, pending: loading,
error, error,
refresh,
} = await useAsyncData( } = await useAsyncData(
() => `search-${route.query.query ?? ''}`, () => `search-${route.query.query ?? ''}`,
async () => { async () => {
@ -210,6 +209,12 @@
} }
); );
watch(error, (value) => {
if (value) {
console.error('数据获取失败: ', value);
}
});
onMounted(() => { onMounted(() => {
if (typeof route.query.query === 'string' && route.query.query.trim()) if (typeof route.query.query === 'string' && route.query.query.trim())
keyword.value = route.query.query; keyword.value = route.query.query;