From 79d2d2e800e6d84d918d72603ecff4f1568ecac4 Mon Sep 17 00:00:00 2001 From: R2m1liA <15258427350@163.com> Date: Tue, 16 Sep 2025 16:02:59 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 基于ESLint格式化代码 --- app/components/JinshenHeader.vue | 8 ++++---- app/composables/useMeilisearch.ts | 10 +++++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/components/JinshenHeader.vue b/app/components/JinshenHeader.vue index e7021ce..a593192 100644 --- a/app/components/JinshenHeader.vue +++ b/app/components/JinshenHeader.vue @@ -77,11 +77,11 @@ const handleSearch = () => { const trimmed = searchQuery.value.trim(); if (!trimmed) return; navigateTo({ - path: localePath('/search'), + path: localePath("/search"), query: { - query: trimmed - } - }) + query: trimmed, + }, + }); searchQuery.value = ""; }; diff --git a/app/composables/useMeilisearch.ts b/app/composables/useMeilisearch.ts index d3d30bc..bcdce46 100644 --- a/app/composables/useMeilisearch.ts +++ b/app/composables/useMeilisearch.ts @@ -41,7 +41,7 @@ export const useMeilisearch = () => { let meiliClient: MeiliSearch | null = null; const ensureClient = () => { - if(meiliClient) return meiliClient; + if (meiliClient) return meiliClient; const host = runtimeConfig.public?.meili?.host; if (!host) { @@ -86,7 +86,8 @@ export const useMeilisearch = () => { indexUid, response: { hits: safeResponse.hits, - estimatedTotalHits: safeResponse.estimatedTotalHits ?? safeResponse.hits.length, + estimatedTotalHits: + safeResponse.estimatedTotalHits ?? safeResponse.hits.length, processingTimeMs: safeResponse.processingTimeMs ?? 0, query: safeResponse.query, }, @@ -98,7 +99,10 @@ export const useMeilisearch = () => { const settled = await Promise.allSettled(requests); settled - .filter((result): result is PromiseRejectedResult => result.status === "rejected") + .filter( + (result): result is PromiseRejectedResult => + result.status === "rejected" + ) .forEach((result) => { console.error("Meilisearch query failed", result.reason); });