koel/resources/assets/js/components/playlist/CreateNewPlaylistContextMenu.vue

28 lines
741 B
Vue
Raw Normal View History

2022-04-15 14:24:30 +00:00
<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>
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-04-24 08:29:14 +00:00
const { base, ContextMenuBase, open, close } = 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-04-15 17:00:08 +00:00
const createPlaylist = () => {
emit('createPlaylist')
close()
}
2022-04-15 14:24:30 +00:00
2022-04-15 17:00:08 +00:00
const createSmartPlaylist = () => {
eventBus.emit('MODAL_SHOW_CREATE_SMART_PLAYLIST_FORM')
close()
}
defineExpose({ open })
2022-04-15 14:24:30 +00:00
</script>