Tiny but powerful notification component
Tiny but powerful notification component with no dependencies.
Usage
Simply add "vs-notify.min.js" file into your project and insert one or more tags anywhere:
Then you can send notifications from Javascript:
You can also pass duration like this:
To close all notifications in a group: this.$notify("alert");
.
See 'test/index.html' for more examples.
Props
- group - name to send notifications to
- position - 'top/bottom' and 'left/right/center', for example: 'bottom left'
- duration - number of milliseconds to show the notification (0 = until user closes it)
- reverse - display notifications in reverse order
- transition - Vue transition name to use
There are several predefined transitions:
- ntf-left - slide notification from the left (default for 'left' position)
- ntf-right - slide notification from the right (default for 'right' position)
- ntf-fade - simply fade-in/fade-out notifications
- ntf-top - slide from the top
- ntf-bottom - slide from the bottom
Custom notifications
You can use the slot "body" for custom notifications:
props.close()
closes the notification.
Styling
You can also use your own notification types:
this.$notify("alert", "Where are my keys?!", "panic");
.vs-notify .panic{ color: red; }