0.0.4 • Published 5 years ago
@aptof/toaster v0.0.4
About
A minimal lightweight toast notification for vue 2. This toast has no configuration option. The position of this toast is top right of the window.
This library does not has any dependency except vue2
Screenshot
Installation
npm install @aptof/toaster
Usage
main.js : Import and use toaster
........
import toaster from '@aptof/toaster'
Vue.use(toaster)
.....
App.vue : Place a toaster element
<template>
<div id="app">
<toaster/>
........
</div>
</template>
In view component
this.$toaster.success('text', 'title')
this.$toaster.info('text', 'title')
this.$toaster.warn('text', 'title')
this.$toaster.error('text', 'title')
In any other place of vue app
import Vue from 'vue'
Vue.toaster.success('text', 'title')
Vue.toaster.info('text', 'title')
Vue.toaster.warn('text', 'title')
Vue.toaster.error('text', 'title')
Customization
There are lot of toast notification library for vue. But the intention of creating another library is to make it minimal and light weight and clean. That's why this toaster does not has any customization option. If you really really want to customize this library, please clone the git repo and change the source code. The plugin source code is in src/plugins/toast directory and it only contains two components, an index.js and a vi.js a total of approx 250 line of code including html and css. The whole git repo is a vue app.