2022-04-15 14:24:30 +00:00
|
|
|
<template>
|
2022-05-08 18:18:27 +00:00
|
|
|
<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>
|
2022-04-24 08:29:14 +00:00
|
|
|
</ContextMenuBase>
|
2022-04-15 14:24:30 +00:00
|
|
|
</template>
|
|
|
|
|
2022-04-15 17:00:08 +00:00
|
|
|
<script lang="ts" setup>
|
2022-04-15 14:24:30 +00:00
|
|
|
import { eventBus } from '@/utils'
|
2022-04-15 17:00:08 +00:00
|
|
|
import { useContextMenu } from '@/composables'
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-06-10 10:47:46 +00:00
|
|
|
const { base, ContextMenuBase, open, trigger } = useContextMenu()
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-04-15 17:00:08 +00:00
|
|
|
const emit = defineEmits(['createPlaylist'])
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-06-10 10:47:46 +00:00
|
|
|
const createPlaylist = () => trigger(() => emit('createPlaylist'))
|
|
|
|
const createSmartPlaylist = () => trigger(() => eventBus.emit('MODAL_SHOW_CREATE_SMART_PLAYLIST_FORM'))
|
2022-04-20 12:38:38 +00:00
|
|
|
|
|
|
|
defineExpose({ open })
|
2022-04-15 14:24:30 +00:00
|
|
|
</script>
|