mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 23:56:42 +08:00
refactor: Enable lazy loading for downloading tabs
This commit is contained in:
@@ -10,6 +10,9 @@ const activeTab = ref(route.query.tab)
|
|||||||
// 下载器
|
// 下载器
|
||||||
const downloaders = ref<DownloaderConf[]>([])
|
const downloaders = ref<DownloaderConf[]>([])
|
||||||
|
|
||||||
|
// 获取启用的下载器
|
||||||
|
const enabledDownloaders = computed(() => downloaders.value.filter(item => item.enabled))
|
||||||
|
|
||||||
// 调用API查询下载器设置
|
// 调用API查询下载器设置
|
||||||
async function loadDownloaderSetting() {
|
async function loadDownloaderSetting() {
|
||||||
try {
|
try {
|
||||||
@@ -35,13 +38,13 @@ onMounted(() => {
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<VTabs v-model="activeTab">
|
<VTabs v-model="activeTab">
|
||||||
<VTab v-for="item in downloaders" :value="item.name" @to="jumpTab(item.name)">
|
<VTab v-for="item in enabledDownloaders" :value="item.name" @to="jumpTab(item.name)">
|
||||||
<span class="mx-5">{{ item.name }}</span>
|
<span class="mx-5">{{ item.name }}</span>
|
||||||
</VTab>
|
</VTab>
|
||||||
</VTabs>
|
</VTabs>
|
||||||
|
|
||||||
<VWindow v-model="activeTab" class="mt-5 disable-tab-transition" :touch="false">
|
<VWindow v-model="activeTab" class="mt-5 disable-tab-transition" :touch="false">
|
||||||
<VWindowItem v-for="item in downloaders" :value="item.name">
|
<VWindowItem v-for="item in enabledDownloaders" :value="item.name">
|
||||||
<transition name="fade-slide" appear>
|
<transition name="fade-slide" appear>
|
||||||
<DownloadingListView :name="item.name" />
|
<DownloadingListView :name="item.name" />
|
||||||
</transition>
|
</transition>
|
||||||
|
|||||||
Reference in New Issue
Block a user