Updated
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
export type ToastOptions = {
|
||||
description?: string;
|
||||
duration?: number;
|
||||
status?: "success" | "error" | "info" | "warning",
|
||||
}
|
||||
status?: "success" | "error" | "info" | "warning";
|
||||
};
|
||||
|
||||
type Toast = {
|
||||
id: number;
|
||||
message: string;
|
||||
options?: ToastOptions
|
||||
}
|
||||
options?: ToastOptions;
|
||||
};
|
||||
|
||||
const toasts = ref<Toast[]>([]);
|
||||
|
||||
@@ -20,12 +20,12 @@ export function useToast() {
|
||||
};
|
||||
|
||||
const destroyToast = (id: number) => {
|
||||
toasts.value = toasts.value.filter(toast => toast.id !== id);
|
||||
toasts.value = toasts.value.filter((toast) => toast.id !== id);
|
||||
};
|
||||
|
||||
return {
|
||||
toasts,
|
||||
addToast,
|
||||
destroyToast
|
||||
destroyToast,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user