mirror of
https://github.com/koel/koel
synced 2024-12-24 19:43:06 +00:00
14 lines
574 B
TypeScript
14 lines
574 B
TypeScript
|
import { MessageToasterKey } from '@/symbols'
|
||
|
import { requireInjection } from '@/utils'
|
||
|
|
||
|
export const useMessageToaster = () => {
|
||
|
const toaster = requireInjection(MessageToasterKey)
|
||
|
|
||
|
return {
|
||
|
toastSuccess: (content: string, timeout?: number) => toaster.value.success(content, timeout),
|
||
|
info: (content: string, timeout?: number) => toaster.value.info(content, timeout),
|
||
|
toastWarning: (content: string, timeout?: number) => toaster.value.warning(content, timeout),
|
||
|
error: (content: string, timeout?: number) => toaster.value.error(content, timeout)
|
||
|
}
|
||
|
}
|