mirror of
https://github.com/koel/koel
synced 2024-12-29 22:13:06 +00:00
15 lines
704 B
TypeScript
15 lines
704 B
TypeScript
|
import { requireInjection } from '@/utils'
|
||
|
import { DialogBoxKey } from '@/symbols'
|
||
|
|
||
|
export const useDialogBox = () => {
|
||
|
const dialogBox = requireInjection(DialogBoxKey)
|
||
|
|
||
|
return {
|
||
|
showSuccessDialog: (message: string, title: string = '') => dialogBox.value.success(message, title),
|
||
|
showInfoDialog: (message: string, title: string = '') => dialogBox.value.info(message, title),
|
||
|
showWarningDialog: (message: string, title: string = '') => dialogBox.value.warning(message, title),
|
||
|
showErrorDialog: (message: string, title: string = '') => dialogBox.value.error(message, title),
|
||
|
showConfirmDialog: (message: string, title: string = '') => dialogBox.value.confirm(message, title)
|
||
|
}
|
||
|
}
|