vue2-notification-new

1.0.2 • Public • Published

Vue2-notification-new


Installation:

Using NPM:

npm install vue2-notification-new --save

Using Yarn:

yarn add vue2-notification-new

Props:

Props Name Type Options
type String Primary, Warning, Danger, Success, Info
duration Number value in MilliSeconds

Events Fired:

Event Name Comments
notification-closed Event fired if notification is explicitly closed by user

Basic Usage:

Template

<notification type="danger" @notification-closed="closed">
    <img src="./assets/logo.png" alt="">
    <span>Lacus pulvinar veniam illum voluptates inceptos exercitation laoreet accumsan? Ullamco.</span>
</notification>

Script

import Notification from 'vue2-notification-new'
 
export default {
    components: {
        Notification
    },
    methods: {
        closed () {
            console.log('Notification was closed explicitly')
        }
    }
}

Setting Notification Duration:

Template

<notification type="danger" :duration="5000" @notification-closed="closed"> //Notification will disappears after 5sec
    <img src="./assets/logo.png" alt="">
    <span>Lacus pulvinar veniam illum voluptates inceptos exercitation laoreet accumsan? Ullamco.</span>
</notification>

Script

import Notification from 'vue2-notification-new'
 
export default {
    components: {
        Notification
    },
    methods: {
        closed () {
            console.log('Notification was closed explicitly')
        }
    }
}

Package Sidebar

Install

npm i vue2-notification-new

Weekly Downloads

1

Version

1.0.2

License

none

Last publish

Collaborators

  • narwanimonish19