0.0.1 • Published 4 years ago

izi-toaster v0.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

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

0.0.1

4 years ago