mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-05-12 02:21:06 +08:00
feat:在多个组件中添加onActivated钩子以优化数据加载逻辑
This commit is contained in:
@@ -30,6 +30,10 @@ async function loadExtraDiscoverSources() {
|
||||
onMounted(async () => {
|
||||
await loadExtraDiscoverSources()
|
||||
})
|
||||
|
||||
onActivated(async () => {
|
||||
loadExtraDiscoverSources()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -29,6 +29,10 @@ function jumpTab(tab: string) {
|
||||
onMounted(async () => {
|
||||
await loadDownloaderSetting()
|
||||
})
|
||||
|
||||
onActivated(async () => {
|
||||
loadDownloaderSetting()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -145,6 +145,10 @@ onBeforeMount(async () => {
|
||||
onMounted(async () => {
|
||||
await loadExtraRecommendSources()
|
||||
})
|
||||
|
||||
onActivated(async () => {
|
||||
loadExtraRecommendSources()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -128,7 +128,7 @@ onMounted(async () => {
|
||||
|
||||
onActivated(async () => {
|
||||
if (!loading.value) {
|
||||
await fetchData()
|
||||
fetchData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user