fix: 完善插件运行态与安装交互 (#694)

This commit is contained in:
InfinityPacer
2026-08-21 18:10:51 +08:00
committed by GitHub
parent 4f1c40af12
commit ea6d0c8178
22 changed files with 1522 additions and 116 deletions
@@ -34,6 +34,11 @@ const props = defineProps({
required: true,
},
count: Number,
// 搜索入口交由列表页接管安装,以便先关闭详情并显示插件级加载状态。
installHandler: {
type: Function as PropType<(releaseVersion?: string, repoUrl?: string) => unknown>,
default: undefined,
},
})
// 定义触发的自定义事件
@@ -130,6 +135,14 @@ async function installPlugin(releaseVersion?: string, repoUrl?: string) {
if (!isConfirmed) return
}
if (props.installHandler) {
versionHistoryDialogController?.close()
versionHistoryDialogController = null
visible.value = false
await props.installHandler(releaseVersion, repoUrl)
return
}
const failureMessageKey = isInstalled.value ? 'plugin.updateFailed' : 'plugin.installFailed'
try {