Skip to content

Commit 524363f

Browse files
committed
refactor: added @nuxtjs/toast
1 parent 83da2e9 commit 524363f

File tree

4 files changed

+23
-1
lines changed

4 files changed

+23
-1
lines changed

nuxt.config.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,23 @@ export default {
4949
*/
5050
modules: [
5151
// Doc: https://axios.nuxtjs.org/usage
52-
'@nuxtjs/axios'
52+
'@nuxtjs/axios',
53+
54+
'@nuxtjs/toast'
5355
],
5456
/*
5557
** Axios module configuration
5658
** See https://axios.nuxtjs.org/options
5759
*/
5860
axios: {},
61+
62+
toast: {
63+
position: 'bottom-center',
64+
duration: 5000,
65+
theme: 'bubble',
66+
register: []
67+
},
68+
5969
/*
6070
** Build configuration
6171
*/

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
},
1414
"dependencies": {
1515
"@nuxtjs/axios": "^5.3.6",
16+
"@nuxtjs/toast": "^3.3.0",
1617
"netlify-identity-widget": "^1.5.6",
1718
"nuxt": "^2.0.0"
1819
},

src/pages/secured.vue

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export default {
2020
if (process.browser) {
2121
if (!this.user) {
2222
this.$router.push('/')
23+
this.$toast.show(`You'll need to login`)
2324
}
2425
}
2526
}

yarn.lock

+10
Original file line numberDiff line numberDiff line change
@@ -1002,6 +1002,12 @@
10021002
nuxt-purgecss "^0.2.1"
10031003
tailwindcss "^1.2.0"
10041004

1005+
"@nuxtjs/toast@^3.3.0":
1006+
version "3.3.0"
1007+
resolved "https://registry.yarnpkg.com/@nuxtjs/toast/-/toast-3.3.0.tgz#fe762dc8a19d81b2a9b5b9e6daac61e5d31821b7"
1008+
dependencies:
1009+
vue-toasted "^1.1.27"
1010+
10051011
"@nuxtjs/youch@^4.2.3":
10061012
version "4.2.3"
10071013
resolved "https://registry.yarnpkg.com/@nuxtjs/youch/-/youch-4.2.3.tgz#36f8b22df5a0efaa81373109851e1d857aca6bed"
@@ -7134,6 +7140,10 @@ vue-template-es2015-compiler@^1.9.0:
71347140
version "1.9.1"
71357141
resolved "https://registry.yarnpkg.com/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.9.1.tgz#1ee3bc9a16ecbf5118be334bb15f9c46f82f5825"
71367142

7143+
vue-toasted@^1.1.27:
7144+
version "1.1.28"
7145+
resolved "https://registry.yarnpkg.com/vue-toasted/-/vue-toasted-1.1.28.tgz#dbabb83acc89f7a9e8765815e491d79f0dc65c26"
7146+
71377147
vue@^2.6.11:
71387148
version "2.6.11"
71397149
resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.11.tgz#76594d877d4b12234406e84e35275c6d514125c5"

0 commit comments

Comments
 (0)