npm.io
1.0.2 • Published 8 years ago

vue2-notification-new

Licence
Version
1.0.2
Deps
2
Vulns
1
Weekly
0

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')
        }
    }
}

Keywords