UNPKG

550 BMarkdownView Raw
1## Toast
2Easy toasts for your app using [mini-toastr](https://github.com/se-panfilov/mini-toastr).
3
4## Setup
5- Add `@nuxtjs/toast` dependency using yarn or npm to your project
6- Add `@nuxtjs/toast` module to `nuxt.config.js`:
7```js
8 modules: [
9 '@nuxtjs/toast'
10 ]
11````
12
13## Usage
14```js
15export default {
16 methods:{
17 async login() {
18 try {
19 await this.$post('auth/login');
20 this.$success('Welcome :)');
21 } catch(e){
22 this.$error('Error while authenticating');
23 }
24 }
25 }
26}
27```