Skip to content

Commit df5ecb6

Browse files
committed
feat: 添加 tab监听以刷新下载列表
1 parent ca51020 commit df5ecb6

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/renderer/components/common/DownloadDrawer.vue

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
>
1818
<n-drawer-content :title="t('download.title')" closable :native-scrollbar="false">
1919
<div class="drawer-container">
20-
<n-tabs type="line" animated class="h-full">
20+
<n-tabs type="line" animated class="h-full" v-model:value="tabName">
2121
<!-- 下载列表 -->
2222
<n-tab-pane name="downloading" :tab="t('download.tabs.downloading')" class="h-full">
2323
<div class="download-list">
@@ -249,7 +249,7 @@ interface DownloadedItem {
249249
picUrl: string;
250250
ar: { name: string }[];
251251
}
252-
252+
const tabName = ref('downloading');
253253
const message = useMessage();
254254
// const playerStore = usePlayerStore();
255255
const settingsStore = useSettingsStore();
@@ -540,6 +540,16 @@ onMounted(() => {
540540
const handleDrawerClose = () => {
541541
settingsStore.showDownloadDrawer = false;
542542
};
543+
544+
545+
watch(
546+
() => tabName.value,
547+
(newVal) => {
548+
if (newVal) {
549+
refreshDownloadedList();
550+
}
551+
}
552+
);
543553
</script>
544554

545555
<style lang="scss" scoped>

0 commit comments

Comments
 (0)