mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-12 12:25:16 +08:00
2.0 KiB
2.0 KiB
Notification
If something is to be telled to you.
UI has designed it long long ago. However, you know, it is always with low piority so I can make a lot of useless animations on it.
Demos
basic
type
change-content
scrollable
closable
duration
API
$NNotification API
Property | Type | Description |
---|---|---|
open | (option: NotificationOption, type: string): NotificationEnvironment |
|
success | (option: NofiticationOption): NotificationEnvironment |
|
info | (option: NofiticationOption): NotificationEnvironment |
|
warning | (option: NofiticationOption): NotificationEnvironment |
|
error | (option: NofiticationOption): NotificationEnvironment |
|
scrollable | boolean |
Default is set to true |
NotificationOption API
Property | Type | Default | Description |
---|---|---|---|
avatar | string | function |
null |
Can be render function |
title | string | function |
null |
Can be render function |
description | string | function |
null |
Can be render function |
content | string | function |
null |
Can be render function |
meta | string | function |
null |
Can be render function |
action | string | function |
null |
Can be render function |
closable | boolean |
true |
|
onClose | (next: function) => any |
next => next() |
Only if next is called notification will close |
onAfterClose | function |
null |
|
onAfterOpen | function |
null |
|
duration | number |
null |
If not set, it won't automatically close |
NotificationEnvironment API
Property of Instance of NofiticationEnvironment can be dynamically set.
Property | Type | Description |
---|---|---|
avatar | string | function |
Can be render function |
title | string | function |
Can be render function |
description | string | function |
Can be render function |
content | string | function |
Can be render function |
meta | string | function |
Can be render function |
action | string | function |
Can be render function |
closable | boolean |
|
onClose | (next: function) => any |
Only if next is called notification will close |
onAfterClose | function |
|
onAfterOpen | function |