Nuxt module for izitoast
- Add
izi-toaster
dependency to your project
yarn add izi-toaster # or npm install izi-toaster
- Add
izi-toaster
to themodules
section ofnuxt.config.js
{
modules: [
'izi-toaster'
]
}
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')
}
}
}
}
Copyright (c) sajan sajan.sahu@live.com