Notifications
We crafted a custom plugin inspired by vue-notifyjs which is simple yet effective.
Usage
To use the notification plugin, import it from the components folder. Note that this is already done in src/main.js
import Notifications from './components/NotificationPlugin'
Vue.use(Notifications)
Trigger Notifications
Notifications
Note:
<notifications></notifications>
can be declared only once anywhere in your app, preferably in your root component so the notification component is alive inside any other components.
Notification options
this.$notify(
{
message: 'Welcome to <b>Material Dashboard</b> - a beautiful freebie for every web developer.',
icon: 'add_alert',
horizontalAlign: horizontalAlign,
verticalAlign: verticalAlign,
type: this.type[color]
})
Props
Notification (passed through the object sent to $notify method)
props: {
message: String,
icon: String,
verticalAlign: {
type: String,
default: 'top'
},
horizontalAlign: {
type: String,
default: 'center'
},
type: {
type: String,
default: 'info'
},
timeout: {
type: Number,
default: 1200
},
timestamp: {
type: Date,
default: () => new Date()
}
}