Notify
Install
Usage
Basic Usage
Notify Type
Custom Notify
Global Method
After registering the Notify component through app.use, the $notify method will be automatically mounted on all subcomponents of the app.
Component Call
API
Methods
| Methods |
Attribute |
Return value |
Description |
| Notify |
`options |
message` |
notify instance |
| Notify.clear |
- |
void |
Close notify |
| Notify.setDefaultOptions |
options |
void |
Set default options of all notifies |
| Notify.resetDefaultOptions |
- |
void |
Reset default options of all notifies |
Options
| Attribute |
Description |
Type |
Default |
| type |
Can be set to primary success warning |
string |
danger |
| message |
Message |
string |
- |
| duration |
Duration(ms), won't disappear if value is 0 |
number | string |
3000 |
| color |
Message color |
string |
white |
| background |
Background color |
string |
- |
| className |
Custom className |
string | Array | object |
- |
| onClick |
Callback function after click |
(event: MouseEvent) => void |
- |
| onOpened |
Callback function after opened |
() => void |
- |
| onClose |
Callback function after close |
() => void |
- |
Less Variables
How to use: Custom Theme.
| Name |
Default Value |
Description |
| @notify-text-color |
@white |
- |
| @notify-padding |
@padding-xs @padding-md |
- |
| @notify-font-size |
@font-size-md |
- |
| @notify-line-height |
@line-height-md |
- |
| @notify-primary-background-color |
@blue |
- |
| @notify-success-background-color |
@green |
- |
| @notify-danger-background-color |
@red |
- |
| @notify-warning-background-color |
@orange |
- |