refactor: 移除未使用的导入和格式问题

This commit is contained in:
alger
2025-05-22 22:21:53 +08:00
parent b621995e24
commit 9eefe62fba
2 changed files with 99 additions and 104 deletions
+2 -4
View File
@@ -132,13 +132,11 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { cloneDeep } from 'lodash';
import type { MenuOption } from 'naive-ui'; import type { MenuOption } from 'naive-ui';
import { NEllipsis, NImage, useMessage, useDialog } from 'naive-ui'; import { NEllipsis, NImage, useMessage, useDialog } from 'naive-ui';
import { computed, h, inject, ref, useTemplateRef } from 'vue'; import { computed, h, inject, ref, useTemplateRef } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { getSongUrl } from '@/store/modules/player';
import { useArtist } from '@/hooks/useArtist'; import { useArtist } from '@/hooks/useArtist';
import { usePlayerStore } from '@/store'; import { usePlayerStore } from '@/store';
import type { SongResult } from '@/type/music'; import type { SongResult } from '@/type/music';
@@ -350,7 +348,7 @@ const handleSelect = (key: string | number) => {
showDropdown.value = false; showDropdown.value = false;
switch (key) { switch (key) {
case 'download': case 'download':
downloadMusic(); downloadMusic(props.item);
break; break;
case 'playNext': case 'playNext':
handlePlayNext(); handlePlayNext();
@@ -376,7 +374,7 @@ const handleSelect = (key: string | number) => {
}; };
// 下载音乐 // 下载音乐
const { isDownloading, downloadMusic } = useDownload(); const { downloadMusic } = useDownload();
const emits = defineEmits(['play', 'select', 'remove-song']); const emits = defineEmits(['play', 'select', 'remove-song']);
const songImageRef = useTemplateRef('songImg'); const songImageRef = useTemplateRef('songImg');
+2 -5
View File
@@ -100,11 +100,9 @@
</n-scrollbar> </n-scrollbar>
</div> </div>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { cloneDeep } from 'lodash';
import { useMessage } from 'naive-ui';
import { computed, onMounted, ref, watch } from 'vue'; import { computed, onMounted, ref, watch } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
@@ -119,7 +117,6 @@ import { isElectron, setAnimationClass, setAnimationDelay } from '@/utils';
const { t } = useI18n(); const { t } = useI18n();
const playerStore = usePlayerStore(); const playerStore = usePlayerStore();
const message = useMessage();
const favoriteList = computed(() => playerStore.favoriteList); const favoriteList = computed(() => playerStore.favoriteList);
const favoriteSongs = ref<SongResult[]>([]); const favoriteSongs = ref<SongResult[]>([]);
const loading = ref(false); const loading = ref(false);