mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-27 18:30:35 +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', {
|
nuxtApp.provide('toast', {
|
||||||
addNotification,
|
addNotification,
|
||||||
removeNotification,
|
removeNotification,
|
||||||
success ({ title, description }: { title?: string, description?: string } = {}) {
|
success ({ title, description, timeout }: { title?: string, description?: string, timeout?: number } = {}) {
|
||||||
addNotification({
|
addNotification({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
title,
|
title,
|
||||||
description,
|
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({
|
addNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title,
|
title,
|
||||||
description,
|
description,
|
||||||
timeout: 4000
|
timeout
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user