mirror of
https://github.com/janishutz/MusicPlayerV2.git
synced 2025-11-25 04:54:23 +00:00
45 lines
1.0 KiB
Vue
45 lines
1.0 KiB
Vue
<template>
|
|
<div>
|
|
<h1>Library</h1>
|
|
<playlistsView
|
|
:playlists="$props.playlists"
|
|
:is-logged-in="$props.isLoggedIn"
|
|
@selected-playlist="( id ) => selectPlaylist( id )"
|
|
@custom-playlist="( pl ) => selectCustomPlaylist( pl )"
|
|
/>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import playlistsView from '@/components/playlistsView.vue';
|
|
import type {
|
|
ReadFile
|
|
} from '@/scripts/song';
|
|
|
|
const emits = defineEmits( [
|
|
'selected-playlist',
|
|
'custom-playlist'
|
|
] );
|
|
|
|
const selectPlaylist = ( id: string ) => {
|
|
emits( 'selected-playlist', id );
|
|
};
|
|
|
|
const selectCustomPlaylist = ( playlist: ReadFile[] ) => {
|
|
emits( 'custom-playlist', playlist );
|
|
};
|
|
|
|
defineProps( {
|
|
'playlists': {
|
|
'default': [],
|
|
'type': Array<any>,
|
|
'required': true,
|
|
},
|
|
'isLoggedIn': {
|
|
'default': false,
|
|
'type': Boolean,
|
|
'required': true,
|
|
}
|
|
} );
|
|
</script>
|