Notify
Notify is a Quasar plugin that can display animated QAlerts (floating above everything in your pages) to users under the form of a notification. They are useful for alerting the user of an event and can even engage the user through actions.
Installation
Edit /quasar.conf.js
:framework: {
plugins: ['Notify']
}
Basic Usage
// outside of a Vue file |
You can see this notification at the bottom of the demo page screen. Please notice the defaults:
- The notification is red.
- It has a timeout of 5000ms.
- It appears floating at the bottom of the screen.
- The animation is determined by the position of the notification on screen.
Config Object
Let’s go deeper and analyze the different optional properties available for a notification.
this.$q.notify({ |
Note
If you define any actions, the notification will automatically be dismissed when user picks it.
Programmatically Closing Alert
Notifications are meant to be dismissed only by the user, however for exceptional cases you can do it programmatically. Especially useful when you set indefinite timeout (0).
const dismiss = this.$q.notify({...}) |
Types of Notifications
Quasar offers the possibility to create out of the box notifications for different types of success or failure messages. The Notify types have specific icons and colors.
The types of Notify we are talking about are: positive
(for success), negative
(for errors), warning
and info
. Here’s how to create them:
this.$q.notify({ |