vue-simple-alert
vue-simple-alert copied to clipboard
vue-simple-alert does not work in Nuxt.js
I am trying to add the vue-simple-alert
package to my Nuxt.js
application but it's not working at all. I have followed below steps:
- Install and add the package to my
package.json
via commandnpm install vue-simple-alert --save
. - Add a file
alert.js
under the folderplugins
within my nuxt.js project and add following code:
import Vue from 'vue'
import alertifyjs from 'alertifyjs'
Vue.use(alertifyjs)
- Add the following lines within
nuxt.config.js
:
plugins: [
{ src: "~/plugins/alert", ssr: false }
],
Then within my pages/text.vue
I added the alert message as per documentation:
this.$alert("Hello Vue Simple Alert.");
The message is displayed as a paragraph text on the Vue page rather than alert message.
I am not understanding whats wrong because I have used other packages similarly and everything worked well with them but same approach does not work for vue-simple-alert
.
Reference documentation: https://www.npmjs.com/package/vue-simple-alert