Skip to content

Commit 3339509

Browse files
committed
fix: 撤回重试按钮相关修改
1 parent b6123e8 commit 3339509

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

docs/.vitepress/theme/components/Download.vue

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { ref, computed } from 'vue'
2+
import { ref, computed, onMounted } from 'vue'
33
import { marked } from 'marked'
44
55
const deviceDropdownRef = ref<HTMLElement | null>(null)
@@ -167,12 +167,15 @@ function handleClickOutside(event: MouseEvent) {
167167
}
168168
}
169169
170-
// 重试获取发布信息的方法
171-
async function retryFetch() {
170+
onMounted(async () => {
171+
// 添加全局点击事件监听
172+
document.addEventListener('click', handleClickOutside)
173+
174+
// 自动获取SecRandom发布信息
172175
isLoading.value = true
173176
hasError.value = false
174177
errorMessage.value = ''
175-
178+
176179
try {
177180
console.log('正在获取GitHub发布信息...')
178181
// 调用GitHub API获取SecRandom的所有发布信息
@@ -249,7 +252,7 @@ async function retryFetch() {
249252
} finally {
250253
isLoading.value = false
251254
}
252-
}
255+
})
253256
</script>
254257

255258
onBeforeUnmount(() => {
@@ -320,7 +323,7 @@ onBeforeUnmount(() => {
320323
<!-- 错误状态 -->
321324
<div v-else-if="hasError" class="error">
322325
<p>{{ errorMessage }}</p>
323-
<button @click="retryFetch" class="retry-button">重试</button>
326+
<button @click="onMounted" class="retry-button">重试</button>
324327

325328
</div>
326329

0 commit comments

Comments
 (0)