From 23deef325a33bd52f90dbd0a1005131b4314c1fd Mon Sep 17 00:00:00 2001 From: Sylvain Marroufin Date: Mon, 9 May 2022 16:12:57 +0200 Subject: [PATCH] feat(toast): add aliases for `info` and `warning` notifications --- src/runtime/plugins/toast.client.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/runtime/plugins/toast.client.ts b/src/runtime/plugins/toast.client.ts index f9957f516e..d5407eba82 100644 --- a/src/runtime/plugins/toast.client.ts +++ b/src/runtime/plugins/toast.client.ts @@ -35,6 +35,22 @@ export default defineNuxtPlugin((nuxtApp) => { timeout }) }, + info ({ title, description, timeout }: { title?: string, description?: string, timeout?: number } = {}) { + addNotification({ + type: 'info', + title, + description, + timeout + }) + }, + warning ({ title, description, timeout }: { title?: string, description?: string, timeout?: number } = {}) { + addNotification({ + type: 'warning', + title, + description, + timeout + }) + }, error ({ title = 'An error occurred!', description, timeout }: { title?: string, description?: string, timeout?: number } = {}) { addNotification({ type: 'error',