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 {
provide: {
copy
clipboard: {
copy
}
}
}
})

View File

@@ -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
})
}
}
}
}