feat:混合模式下,当点击“Spark”或“APM”的子开关时,也会刷新是否已安装逻辑

This commit is contained in:
2026-03-11 14:24:14 +08:00
parent 207334608c
commit b3cef63bf5
2 changed files with 12 additions and 0 deletions

View File

@@ -69,6 +69,7 @@
@remove="onDetailRemove" @remove="onDetailRemove"
@open-preview="openScreenPreview" @open-preview="openScreenPreview"
@open-app="openDownloadedApp" @open-app="openDownloadedApp"
@check-install="checkAppInstalled"
/> />
<ScreenPreview <ScreenPreview

View File

@@ -274,6 +274,7 @@ const emit = defineEmits<{
(e: "remove", app: App): void; (e: "remove", app: App): void;
(e: "open-preview", index: number): void; (e: "open-preview", index: number): void;
(e: "open-app", pkgname: string): void; (e: "open-app", pkgname: string): void;
(e: "check-install", app: App): void;
}>(); }>();
const appPkgname = computed(() => props.app?.pkgname); const appPkgname = computed(() => props.app?.pkgname);
@@ -305,6 +306,16 @@ const displayApp = computed(() => {
: props.app.apmApp || props.app; : props.app.apmApp || props.app;
}); });
watch(
() => displayApp.value,
(newApp) => {
if (newApp) {
emit("check-install", newApp);
}
},
{ immediate: false },
);
const activeDownload = computed(() => { const activeDownload = computed(() => {
return downloads.value.find((d) => d.pkgname === displayApp.value?.pkgname); return downloads.value.find((d) => d.pkgname === displayApp.value?.pkgname);
}); });