mirror of
https://github.com/koel/koel
synced 2024-12-30 06:23:05 +00:00
27 lines
741 B
Vue
27 lines
741 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, close } = useContextMenu()
|
|
|
|
const emit = defineEmits(['createPlaylist'])
|
|
|
|
const createPlaylist = () => {
|
|
emit('createPlaylist')
|
|
close()
|
|
}
|
|
|
|
const createSmartPlaylist = () => {
|
|
eventBus.emit('MODAL_SHOW_CREATE_SMART_PLAYLIST_FORM')
|
|
close()
|
|
}
|
|
|
|
defineExpose({ open })
|
|
</script>
|