mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
feat(toast): expose timeout to alias methods (#30)
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
committed by
GitHub
parent
b7f6bf93d3
commit
6bd51975bf
@@ -27,20 +27,20 @@ export default defineNuxtPlugin((nuxtApp) => {
|
||||
nuxtApp.provide('toast', {
|
||||
addNotification,
|
||||
removeNotification,
|
||||
success ({ title, description }: { title?: string, description?: string } = {}) {
|
||||
success ({ title, description, timeout }: { title?: string, description?: string, timeout?: number } = {}) {
|
||||
addNotification({
|
||||
type: 'success',
|
||||
title,
|
||||
description,
|
||||
timeout: 4000
|
||||
timeout
|
||||
})
|
||||
},
|
||||
error ({ title = 'An error occurred!', description }: { title?: string, description?: string } = {}) {
|
||||
error ({ title = 'An error occurred!', description, timeout }: { title?: string, description?: string, timeout?: number } = {}) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
title,
|
||||
description,
|
||||
timeout: 4000
|
||||
timeout
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user