Minimalist global notifications for your Vue 3 application
npm i --save @aminoeditor/vue-notify
Install the plugin
// main.js
import { createApp } from 'vue'
import App from './App.vue'
import VueNotify from '@aminoeditor/vue-notify';
createApp(App)
.use(VueNotify)
.mount('#app')
Load the default styles
// App.vue
<style lang="scss">
@import "@aminoeditor/vue-notify";
</style>
<template>
<a @click.prevent="$notify('Hello World!')">Say Hello</a>
</template>
//main.js
createApp(App)
.use(VueNotify, {
global: 'toast' // now you can call this.$toast('Hello World');
})
.mount('#app');
Key | Data Type | Description | Default |
---|---|---|---|
global | String | Rename the global option key | notify |
this.$notify('Hello World!', {
displayMs: 5000 // how long before notification should disappear
});
Key | Data Type | Description | Default |
---|---|---|---|
displayMs | Number | Set display time (in ms) for notification | 2500 |
Thanks goes to these wonderful people (emoji key):
Timothy Long 💻 🎨 |
Eric Uldall 💻 |
This project follows the all-contributors specification. Contributions of any kind welcome!