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