mirror of
https://github.com/koel/koel
synced 2024-12-20 09:33:23 +00:00
16 lines
429 B
TypeScript
16 lines
429 B
TypeScript
import { defineAsyncComponent, ref } from 'vue'
|
|
|
|
export const useContextMenu = () => {
|
|
const BaseContextMenu = defineAsyncComponent(() => import('@/components/ui/context-menu.vue'))
|
|
const base = ref<InstanceType<typeof BaseContextMenu>>()
|
|
|
|
const open = (top: number, left: number) => base.value?.open(top, left)
|
|
const close = () => base.value?.close()
|
|
|
|
return {
|
|
base,
|
|
BaseContextMenu,
|
|
open,
|
|
close
|
|
}
|
|
}
|