Skip to content

Commit

Permalink
只有第一次才显示骨架屏
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaojianli committed Nov 7, 2024
1 parent 405a184 commit a40524e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions webui/src/components/autoUpdateBtn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
</template>

<script setup lang="ts">
import { useAutoUpdate } from '@/stores/autoUpdate';
import { computed, onMounted, onUnmounted, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { useAutoUpdate } from '@/stores/autoUpdate'
import { computed, onMounted, onUnmounted, ref } from 'vue'
import { useI18n } from 'vue-i18n'
const { t, d } = useI18n()
const autoUpdate = useAutoUpdate()
const autoUpdateBtn = ref()
Expand Down
6 changes: 4 additions & 2 deletions webui/src/views/dashboard/components/clientStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
]"
>
<!-- 骨架屏 -->
<a-col v-if="!data || data?.length === 0 || loading" :xs="24" :sm="12" :md="8" :lg="6">
<a-col v-if="!data || data?.length === 0 || firstLoading" :xs="24" :sm="12" :md="8" :lg="6">
<a-card hoverable :header-style="{ height: 'auto' }">
<template #title>
<a-skeleton :animation="true">
Expand Down Expand Up @@ -82,12 +82,14 @@ import torrentList from './torrentList.vue'
const { t } = useI18n()
const endpointState = useEndpointStore()
const data = ref<Downloader[]>()
const { refresh, loading } = useRequest(
const firstLoading = ref(true)
const { refresh } = useRequest(
getDownloaders,
{
cacheKey: () => `${endpointState.endpoint}-downloader`,
onSuccess: (res) => {
data.value = res.data
firstLoading.value = false
}
},
[useAutoUpdatePlugin]
Expand Down

0 comments on commit a40524e

Please sign in to comment.