2022-11-18 17:45:38 +00:00
|
|
|
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),
|
2022-11-18 19:30:43 +00:00
|
|
|
toastInfo: (content: string, timeout?: number) => toaster.value.info(content, timeout),
|
2022-11-18 17:45:38 +00:00
|
|
|
toastWarning: (content: string, timeout?: number) => toaster.value.warning(content, timeout),
|
2022-11-18 19:30:43 +00:00
|
|
|
toastError: (content: string, timeout?: number) => toaster.value.error(content, timeout)
|
2022-11-18 17:45:38 +00:00
|
|
|
}
|
|
|
|
}
|