fix(plugins): error in provides

This commit is contained in:
Benjamin Canac
2022-07-15 22:11:45 +02:00
parent 1d8958c2fc
commit 46ea467098
2 changed files with 38 additions and 34 deletions

View File

@@ -26,7 +26,9 @@ export default defineNuxtPlugin((nuxtApp) => {
return { return {
provide: { provide: {
copy clipboard: {
copy
}
} }
} }
}) })

View File

@@ -25,39 +25,41 @@ export default defineNuxtPlugin(() => {
return { return {
provide: { provide: {
addNotification, toast: {
removeNotification, addNotification,
success ({ title, description, timeout }: { title?: string, description?: string, timeout?: number } = {}) { removeNotification,
addNotification({ success ({ title, description, timeout }: { title?: string, description?: string, timeout?: number } = {}) {
type: 'success', addNotification({
title, type: 'success',
description, title,
timeout description,
}) timeout
}, })
info ({ title, description, timeout }: { title?: string, description?: string, timeout?: number } = {}) { },
addNotification({ info ({ title, description, timeout }: { title?: string, description?: string, timeout?: number } = {}) {
type: 'info', addNotification({
title, type: 'info',
description, title,
timeout description,
}) timeout
}, })
warning ({ title, description, timeout }: { title?: string, description?: string, timeout?: number } = {}) { },
addNotification({ warning ({ title, description, timeout }: { title?: string, description?: string, timeout?: number } = {}) {
type: 'warning', addNotification({
title, type: 'warning',
description, title,
timeout description,
}) timeout
}, })
error ({ title = 'An error occurred!', description, timeout }: { title?: string, description?: string, timeout?: number } = {}) { },
addNotification({ error ({ title = 'An error occurred!', description, timeout }: { title?: string, description?: string, timeout?: number } = {}) {
type: 'error', addNotification({
title, type: 'error',
description, title,
timeout description,
}) timeout
})
}
} }
} }
} }