2022-04-15 14:24:30 +00:00
|
|
|
<template>
|
2022-09-08 05:06:49 +00:00
|
|
|
<ContextMenuBase ref="base">
|
2022-12-02 16:17:37 +00:00
|
|
|
<li @click="editPlaylist">Edit</li>
|
|
|
|
<li @click="deletePlaylist">Delete</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-11-15 15:52:38 +00:00
|
|
|
import { ref } from 'vue'
|
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-12-02 16:17:37 +00:00
|
|
|
const { base, ContextMenuBase, open, trigger } = useContextMenu()
|
2022-09-08 05:06:49 +00:00
|
|
|
const playlist = ref<Playlist>()
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-12-02 16:17:37 +00:00
|
|
|
const editPlaylist = () => trigger(() => eventBus.emit('MODAL_SHOW_EDIT_PLAYLIST_FORM', playlist.value!))
|
|
|
|
const deletePlaylist = () => trigger(() => eventBus.emit('PLAYLIST_DELETE', playlist.value!))
|
2022-04-20 10:35:36 +00:00
|
|
|
|
2022-11-15 15:52:38 +00:00
|
|
|
eventBus.on('PLAYLIST_CONTEXT_MENU_REQUESTED', async (event, _playlist) => {
|
|
|
|
playlist.value = _playlist
|
2022-12-02 16:17:37 +00:00
|
|
|
await open(event.pageY, event.pageX)
|
2022-09-08 05:06:49 +00:00
|
|
|
})
|
2022-04-15 14:24:30 +00:00
|
|
|
</script>
|