|
|
@@ -1,5 +1,5 @@
|
|
|
<script setup lang="ts">
|
|
|
-import { computed, onMounted } from 'vue'
|
|
|
+import { computed, onMounted, watch } from 'vue'
|
|
|
import { useI18n } from 'vue-i18n'
|
|
|
import { useVersionsStore } from '@/stores/versions'
|
|
|
import { useInstallStore } from '@/stores/install'
|
|
|
@@ -25,6 +25,17 @@ onMounted(() => {
|
|
|
installStore.checkClaudeCodeExtInstalled()
|
|
|
})
|
|
|
|
|
|
+// 监听安装状态变化,当安装完成(成功或失败)时刷新扩展状态
|
|
|
+watch(
|
|
|
+ () => status.value.installing,
|
|
|
+ (installing, wasInstalling) => {
|
|
|
+ // 从安装中变为非安装中状态时,刷新扩展安装状态
|
|
|
+ if (wasInstalling && !installing) {
|
|
|
+ installStore.checkClaudeCodeExtInstalled()
|
|
|
+ }
|
|
|
+ }
|
|
|
+)
|
|
|
+
|
|
|
// 用户想要安装的软件(未安装且用户勾选了)
|
|
|
const wantInstallNodejs = computed(() => !installStore.isInstalled('nodejs') && installStore.installOptions.all.installNodejs)
|
|
|
const wantInstallPnpm = computed(() => !installStore.isInstalled('pnpm') && installStore.installOptions.all.installPnpm)
|