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