mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-04-03 14:20:50 +08:00
feat: 添加 tab监听以刷新下载列表
This commit is contained in:
@@ -17,7 +17,7 @@
|
|||||||
>
|
>
|
||||||
<n-drawer-content :title="t('download.title')" closable :native-scrollbar="false">
|
<n-drawer-content :title="t('download.title')" closable :native-scrollbar="false">
|
||||||
<div class="drawer-container">
|
<div class="drawer-container">
|
||||||
<n-tabs type="line" animated class="h-full">
|
<n-tabs type="line" animated class="h-full" v-model:value="tabName">
|
||||||
<!-- 下载列表 -->
|
<!-- 下载列表 -->
|
||||||
<n-tab-pane name="downloading" :tab="t('download.tabs.downloading')" class="h-full">
|
<n-tab-pane name="downloading" :tab="t('download.tabs.downloading')" class="h-full">
|
||||||
<div class="download-list">
|
<div class="download-list">
|
||||||
@@ -249,7 +249,7 @@ interface DownloadedItem {
|
|||||||
picUrl: string;
|
picUrl: string;
|
||||||
ar: { name: string }[];
|
ar: { name: string }[];
|
||||||
}
|
}
|
||||||
|
const tabName = ref('downloading');
|
||||||
const message = useMessage();
|
const message = useMessage();
|
||||||
// const playerStore = usePlayerStore();
|
// const playerStore = usePlayerStore();
|
||||||
const settingsStore = useSettingsStore();
|
const settingsStore = useSettingsStore();
|
||||||
@@ -540,6 +540,16 @@ onMounted(() => {
|
|||||||
const handleDrawerClose = () => {
|
const handleDrawerClose = () => {
|
||||||
settingsStore.showDownloadDrawer = false;
|
settingsStore.showDownloadDrawer = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => tabName.value,
|
||||||
|
(newVal) => {
|
||||||
|
if (newVal) {
|
||||||
|
refreshDownloadedList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
Reference in New Issue
Block a user