From 89ff6b6702179fde2fff3294a1909463883378ae Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Mon, 22 Apr 2024 17:15:28 +0200 Subject: [PATCH] feat(useToast): add `clear` method --- src/runtime/composables/useToast.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/runtime/composables/useToast.ts b/src/runtime/composables/useToast.ts index 9821fbef..781047d2 100644 --- a/src/runtime/composables/useToast.ts +++ b/src/runtime/composables/useToast.ts @@ -50,10 +50,15 @@ export function useToast() { }, 200) } + function clear() { + toasts.value = [] + } + return { toasts, add, update, - remove + remove, + clear } }