From d5266c6af81eb6aa28e2f376c88affbea227a5f7 Mon Sep 17 00:00:00 2001 From: Elysia Date: Thu, 12 Feb 2026 20:11:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 现在更换app类别时将默认清空搜索。 --- README.md | 21 +-------------------- src/App.vue | 2 ++ src/components/AppHeader.vue | 20 ++++++++++++-------- src/components/UninstallConfirmModal.vue | 5 ++--- 4 files changed, 17 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index d8ae4b53..226572cf 100644 --- a/README.md +++ b/README.md @@ -16,25 +16,6 @@ --- -## TODO - -- [ ] 完善项目文档 -- [x] 可以展示应用列表及其详细信息 -- [ ] 实现应用下载&下载列表管理 - - [x] 实现应用安装&重试安装 - - [x] 实现应用卸载 - - [x] 实现应用更新 - - [x] 显示本地已安装app - - [x] 支持显示本地是否已经安装 - - [x] 本地应用列表区分依赖和用户安装的包(或者干脆不显示依赖包) - - [x] 安装/卸载时UI提示(重要) -- [x] 实现应用搜索 - - [ ] 切换分类时默认不应用搜索,需按下回车键才应用搜索 -- [x] 修改UI,使其更美观(考虑换成如tailwindcss等库) -- [x] 实现URL Shceme协议支持 -- [ ] 动画性能问题 - - ## 📦 关于 APM **APM (AmberPM)** 是基于 `fuse-overlayfs` + `dpkg` + `AmberCE` 的容器化兼容层,为多发行版提供轻量级的应用运行方案。 @@ -190,7 +171,7 @@ apm-app-store/ ## 📄 开源协议 -本项目采用 [MulanPSL-2.0](LICENSE) 协议开源。 +本项目采用 [MulanPSL-2.0](LICENSE.md) 协议开源。 --- diff --git a/src/App.vue b/src/App.vue index a07a977c..a0edeaae 100644 --- a/src/App.vue +++ b/src/App.vue @@ -18,6 +18,7 @@
{ const selectCategory = (category: string) => { activeCategory.value = category; + searchQuery.value = ""; }; const openDetail = (app: App) => { diff --git a/src/components/AppHeader.vue b/src/components/AppHeader.vue index 1c8dd00a..bbe0b782 100644 --- a/src/components/AppHeader.vue +++ b/src/components/AppHeader.vue @@ -12,8 +12,8 @@ id="searchBox" v-model="localSearchQuery" class="w-full rounded-2xl border border-slate-200/70 bg-white/80 py-3 pl-12 pr-4 text-sm text-slate-700 shadow-sm outline-none transition placeholder:text-slate-400 focus:border-brand/50 focus:ring-4 focus:ring-brand/10 dark:border-slate-800/70 dark:bg-slate-900/60 dark:text-slate-200" - placeholder="搜索应用名 / 包名 / 标签" - @input="debounceSearch" + placeholder="搜索应用名 / 包名 / 标签,按回车键搜索" + @keydown.enter="handleSearch" /> @@ -30,6 +30,7 @@ import TopActions from "./TopActions.vue"; const props = defineProps<{ searchQuery: string; + activeCategory: string; appsCount: number; }>(); @@ -40,13 +41,9 @@ const emit = defineEmits<{ }>(); const localSearchQuery = ref(props.searchQuery || ""); -const timeoutId = ref | null>(null); -const debounceSearch = () => { - if (timeoutId.value) clearTimeout(timeoutId.value); - timeoutId.value = setTimeout(() => { - emit("update-search", localSearchQuery.value); - }, 220); +const handleSearch = () => { + emit("update-search", localSearchQuery.value); }; watch( @@ -55,4 +52,11 @@ watch( localSearchQuery.value = newVal || ""; }, ); + +watch( + () => props.activeCategory, + () => { + localSearchQuery.value = ""; + }, +); diff --git a/src/components/UninstallConfirmModal.vue b/src/components/UninstallConfirmModal.vue index 56a38d8a..4dfcda96 100644 --- a/src/components/UninstallConfirmModal.vue +++ b/src/components/UninstallConfirmModal.vue @@ -159,10 +159,9 @@ const onProgress = (_event: any, chunk: string) => { scrollToBottom(); }; -// eslint-disable-next-line @typescript-eslint/no-explicit-any const onComplete = ( - _event: any, - result: { success: boolean; message: any }, + _event: unknown, + result: { success: boolean; message: unknown }, ) => { if (!uninstalling.value) return; // Ignore if not current session