Skip to content

Commit

Permalink
feat:在多个组件中添加onActivated钩子以优化数据加载逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
jxxghp committed Feb 11, 2025
1 parent 3df5d75 commit 787cccb
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/pages/discover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ async function loadExtraDiscoverSources() {
onMounted(async () => {
await loadExtraDiscoverSources()
})
onActivated(async () => {
loadExtraDiscoverSources()
})
</script>

<template>
Expand Down
4 changes: 4 additions & 0 deletions src/pages/downloading.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ function jumpTab(tab: string) {
onMounted(async () => {
await loadDownloaderSetting()
})
onActivated(async () => {
loadDownloaderSetting()
})
</script>

<template>
Expand Down
4 changes: 4 additions & 0 deletions src/pages/recommend.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ onBeforeMount(async () => {
onMounted(async () => {
await loadExtraRecommendSources()
})
onActivated(async () => {
loadExtraRecommendSources()
})
</script>

<template>
Expand Down
2 changes: 1 addition & 1 deletion src/views/subscribe/SubscribeListView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ onMounted(async () => {
onActivated(async () => {
if (!loading.value) {
await fetchData()
fetchData()
}
})
</script>
Expand Down

0 comments on commit 787cccb

Please sign in to comment.