npm

npm’s 2019 JavaScript ecosystem survey analysis is now available!Get your copy here »

vue-floating-alert

1.0.3 • Public • Published

vue-floating-alert

Build

Install

$ npm i --save vue-floating-alert

Usage in components

// app.vue
 
<template>
    <div>   
        <FloatingAlert language="pt-BR" />
    </div>
</template>
 
<script>
import Vue from 'vue'
import VueFloatingAlert from 'vue-floating-alert'
 
Vue.use(VueFloatingAlert)
 
export default {
    mounted() {
        setTimeout(() => {
            this.$floatingAlert.success({
                title: 'Success!',
                message: 'Woohoo! <i class="fa fa-fw fa-grin-wink"></i>',
            })
        }, 1000)
    },
}
</script>

Usage in other files

// app.vue
 
import {floatingAlert} from 'vue-floating-alert'
 
export default {
    doSomething() {
        floatingAlert.success({
            title: 'Success!',
            message: 'Woohoo! <i class="fa fa-fw fa-grin-wink"></i>',
        })
    },
}

Methods

this.$floatingAlert.error({
    message: "That's an error :(",
})
 
this.$floatingAlert.warn({
    title: "Hey you",
    message: "Be careful with that",
})
 
this.$floatingAlert.info({
    title: 'Just to let you know',
    message: "We'll send you an email when we're finished",
})
 
this.$floatingAlert.success({
    title: "Awesome!",
    message: "You've finished reading all your emails. Now go play outside.",
})
 
// if you don't want to wait, you can close it on your own
this.$floatingAlert.hide() 

License

MIT

install

npm i vue-floating-alert

Downloadsweekly downloads

6

version

1.0.3

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability