izi-toaster

0.0.1 • Public • Published

izi-toaster

Nuxt module for izitoast

Setup

  1. Add izi-toaster dependency to your project
yarn add izi-toaster # or npm install izi-toaster 
  1. Add izi-toaster to the modules section of nuxt.config.js
{
  modules: [
    'izi-toaster'
  ]
}

Usage

You can use $toaster in almost any context using app.$toaster or this.$toaster (Including store actions).

See toasted official docs for more usage information.

export default {
   methods:{
     async login() {
         try {
             this.$toaster.show('Logging in...')
             await this.$axios.$post('auth/login')
             this.$toaster.success('Successfully authenticated')
         } catch(e){
             this.$toaster.error('Error while authenticating')
         }
     }  
   }
}

License

MIT License

Copyright (c) sajan sajan.sahu@live.com

Readme

Keywords

none

Package Sidebar

Install

npm i izi-toaster

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

4.63 kB

Total Files

6

Last publish

Collaborators

  • sajan45