add MusicPlayer

This commit is contained in:
Timi
2026-04-09 20:53:46 +08:00
parent 788db69bc8
commit d9e32c4dbe
12 changed files with 1059 additions and 14 deletions

View File

@@ -6,6 +6,8 @@
:items="currentItems"
:pending-path="pendingFolderPath"
@open="openItem"
@queue="queueItem"
@play="playItem"
/>
<file-explorer-grid
v-else
@@ -44,12 +46,14 @@ const props = withDefaults(defineProps<{
useRoutePath: true
});
const emit = defineEmits<{
"update:path": [value: string[]];
"open-folder": [value: string[]];
"open-file": [value: ExplorerItem];
"update:mode": [value: DisplayMode];
}>();
const emit = defineEmits([
"update:path",
"open-folder",
"open-file",
"queue-file",
"play-file",
"update:mode"
]);
const route = useRoute();
const router = useRouter();
@@ -220,6 +224,15 @@ async function openItem(item: ExplorerItem): Promise<void> {
emit("open-file", item);
}
function queueItem(item: ExplorerItem): void {
emit("queue-file", item);
}
function playItem(item: ExplorerItem): void {
console.log("play-item", item);
emit("play-file", item);
}
async function syncPath(nextSegments: string[]): Promise<void> {
if (shouldUseRoutePath.value) {
if (!nextSegments.length) {