koel/resources/assets/js/components/playlist/CreateNewPlaylistContextMenu.vue
2022-07-04 10:36:39 +02:00

20 lines
740 B
Vue

<template>
<ContextMenuBase ref="base" extra-class="playlist-menu">
<li data-testid="playlist-context-menu-create-simple" @click="createPlaylist">New Playlist</li>
<li data-testid="playlist-context-menu-create-smart" @click="createSmartPlaylist">New Smart Playlist</li>
</ContextMenuBase>
</template>
<script lang="ts" setup>
import { eventBus } from '@/utils'
import { useContextMenu } from '@/composables'
const { base, ContextMenuBase, open, trigger } = useContextMenu()
const emit = defineEmits(['createPlaylist'])
const createPlaylist = () => trigger(() => emit('createPlaylist'))
const createSmartPlaylist = () => trigger(() => eventBus.emit('MODAL_SHOW_CREATE_SMART_PLAYLIST_FORM'))
defineExpose({ open })
</script>