Skip to content

Commit

Permalink
feat(toast): add aliases for info and warning notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
smarroufin committed May 9, 2022
1 parent 4b4d165 commit 23deef3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/runtime/plugins/toast.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 23deef3

Please sign in to comment.