Skip to content

Commit

Permalink
fix(plugins): error in provides
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamincanac committed Jul 15, 2022
1 parent 1d8958c commit 46ea467
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 34 deletions.
4 changes: 3 additions & 1 deletion src/runtime/plugins/clipboard.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ export default defineNuxtPlugin((nuxtApp) => {

return {
provide: {
copy
clipboard: {
copy
}
}
}
})
Expand Down
68 changes: 35 additions & 33 deletions src/runtime/plugins/toast.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
}
}
}
}
Expand Down

0 comments on commit 46ea467

Please sign in to comment.