♻️ refactor: useAlert composable updated
This commit is contained in:
parent
2dda891c43
commit
95a1699f2f
|
@ -2,23 +2,24 @@ import { useToast } from "primevue/usetoast";
|
|||
import type IVAlert from "@/components/alert/IVAlert.type.js";
|
||||
|
||||
export function useAlert() {
|
||||
const toast = useToast();
|
||||
|
||||
const showAlert = ({
|
||||
title = '',
|
||||
description = '',
|
||||
type = 'info',
|
||||
closeable = true,
|
||||
lifeTime,
|
||||
}: IVAlert) => {
|
||||
}: IVAlert) => {
|
||||
const toast = useToast();
|
||||
|
||||
toast.add({
|
||||
severity: type,
|
||||
summary: title,
|
||||
detail: description,
|
||||
life: lifeTime,
|
||||
closable: closeable,
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
return { showAlert}
|
||||
return { showAlert };
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user