From 46ea467098441b96329383154e7e60fd8ebbec06 Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Fri, 15 Jul 2022 22:11:45 +0200 Subject: [PATCH] fix(plugins): error in provides --- src/runtime/plugins/clipboard.client.ts | 4 +- src/runtime/plugins/toast.client.ts | 68 +++++++++++++------------ 2 files changed, 38 insertions(+), 34 deletions(-) diff --git a/src/runtime/plugins/clipboard.client.ts b/src/runtime/plugins/clipboard.client.ts index ebb8275fb4..2475ac7dda 100644 --- a/src/runtime/plugins/clipboard.client.ts +++ b/src/runtime/plugins/clipboard.client.ts @@ -26,7 +26,9 @@ export default defineNuxtPlugin((nuxtApp) => { return { provide: { - copy + clipboard: { + copy + } } } }) diff --git a/src/runtime/plugins/toast.client.ts b/src/runtime/plugins/toast.client.ts index 5ef9890556..ac7186db84 100644 --- a/src/runtime/plugins/toast.client.ts +++ b/src/runtime/plugins/toast.client.ts @@ -25,39 +25,41 @@ export default defineNuxtPlugin(() => { return { provide: { - addNotification, - removeNotification, - success ({ title, description, timeout }: { title?: string, description?: string, timeout?: number } = {}) { - addNotification({ - type: 'success', - title, - description, - 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', - title, - description, - timeout - }) + toast: { + addNotification, + removeNotification, + success ({ title, description, timeout }: { title?: string, description?: string, timeout?: number } = {}) { + addNotification({ + type: 'success', + title, + description, + 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', + title, + description, + timeout + }) + } } } }