feat:在多个组件中添加onActivated钩子以优化数据加载逻辑

This commit is contained in:
jxxghp
2025-02-11 17:15:55 +08:00
parent 3df5d75c46
commit 787cccb89f
4 changed files with 13 additions and 1 deletions

View File

@@ -30,6 +30,10 @@ async function loadExtraDiscoverSources() {
onMounted(async () => {
await loadExtraDiscoverSources()
})
onActivated(async () => {
loadExtraDiscoverSources()
})
</script>
<template>

View File

@@ -29,6 +29,10 @@ function jumpTab(tab: string) {
onMounted(async () => {
await loadDownloaderSetting()
})
onActivated(async () => {
loadDownloaderSetting()
})
</script>
<template>

View File

@@ -145,6 +145,10 @@ onBeforeMount(async () => {
onMounted(async () => {
await loadExtraRecommendSources()
})
onActivated(async () => {
loadExtraRecommendSources()
})
</script>
<template>

View File

@@ -128,7 +128,7 @@ onMounted(async () => {
onActivated(async () => {
if (!loading.value) {
await fetchData()
fetchData()
}
})
</script>