fix(mini): 迷你模式右键'添加到歌单'恢复主窗口后接力打开歌单抽屉

Mini 窗口宽 340px 容不下 420px 歌单抽屉,此前 provide 的是空实现点击
无反应。现记录待添加歌曲 → window.api.restore() 恢复主窗口 →
AppLayout 挂载后自动打开歌单抽屉完成添加。

Closes #504
This commit is contained in:
alger
2026-07-05 15:16:50 +08:00
parent 9618cb9521
commit 7af71074d2
2 changed files with 13 additions and 2 deletions
@@ -182,9 +182,11 @@ const palyListRef = useTemplateRef('palyListRef') as any;
const isPlaylistOpen = ref(false);
// 提供 openPlaylistDrawer 给子组件
// Mini 窗口(340px 宽)容不下 420px 的歌单抽屉:记录待添加歌曲并恢复主窗口,
// AppLayout 重新挂载后接力打开抽屉(#504)
provide('openPlaylistDrawer', (songId: number) => {
console.log('打开歌单抽屉', songId);
// 由于在迷你模式不处理这个功能,所以只记录日志
localStorage.setItem('pendingAddToPlaylistSongId', String(songId));
window.api.restore();
});
// 切换播放列表显示/隐藏