Vue-UbiNotify

Installation

npm install ubi-vue-notify

Configuration

Have a play with the demo above and when you've got everything set up the way you like, copy and paste the following directly before creating your root Vue instance.

Remember to install your chosen CSS animation library as well. I recommend UbiAnimate.

import UbiNotify from "vue-ubi-notify";
const UbiNotifyConfig =
{
    name: "CHANGE_THIS_TO_A_UNIQUE_STRING",
    position: "top right",
    duration: 5000,
    stackFromTop: true,
    cssFramework: "default",
    animation: {
        enterActive: "ubi-notify-transition-fade-in",
        leaveActive: "ubi-notify-transition-fade-out",
        move: "ubi-notify-transition-move-7",
    },    
    notification: {
        canBeRemoved: true,
        defaultType: "default",
    },    
}
Vue.use(UbiNotify, UbiNotifyConfig);

Usage

Sending a notification is as simple as calling the $notify method from within your Vue instance.

Message types can be either "default", "primary", "success", "warning" or "danger".

Duration should be in milliseconds.

this.$notify(messageBody, messageHeading = null, messageType = null, duration = null);