Skip to content

Commit 54d66d0

Browse files
committed
🔧 chore: 更新 MusicListPage 组件,添加移动端布局判断,优化紧凑布局逻辑
1 parent b32408b commit 54d66d0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/renderer/views/music/MusicListPage.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
{{ t('comp.musicList.addToPlaylist') }}
3838
</n-tooltip>
3939
<!-- 布局切换按钮 -->
40-
<div class="layout-toggle">
40+
<div class="layout-toggle" v-if="!isMobile">
4141
<n-tooltip placement="bottom" trigger="hover">
4242
<template #trigger>
4343
<div class="toggle-button hover-green" @click="toggleLayout">
@@ -165,7 +165,7 @@ import SongItem from '@/components/common/SongItem.vue';
165165
import PlayBottom from '@/components/common/PlayBottom.vue';
166166
import { useMusicStore, usePlayerStore } from '@/store';
167167
import { SongResult } from '@/type/music';
168-
import { getImgUrl, setAnimationClass } from '@/utils';
168+
import { getImgUrl, isMobile, setAnimationClass } from '@/utils';
169169
170170
const { t } = useI18n();
171171
const route = useRoute();
@@ -196,7 +196,7 @@ const isFullPlaylistLoaded = ref(false); // 标记完整播放列表是否已加
196196
197197
// 添加搜索相关的状态和方法
198198
const isSearchVisible = ref(false);
199-
const isCompactLayout = ref(localStorage.getItem('musicListLayout') === 'compact'); // 默认使用紧凑布局
199+
const isCompactLayout = ref(isMobile.value ? false : localStorage.getItem('musicListLayout') === 'compact'); // 默认使用紧凑布局
200200
201201
const showSearch = () => {
202202
isSearchVisible.value = true;

0 commit comments

Comments
 (0)