add MusicPlayer
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user