I've been attempting to integrate the vue-simple-alert package into my Nuxt.js
application, but unfortunately, it's not functioning as expected. Here are the steps I've followed:
- First, I installed and added the package to my
package.json
using the command
.npm install vue-simple-alert --save
- Next, I created a file named
alert.js
in theplugins
folder of my Nuxt.js project with the following code:
import Vue from 'vue'
import { VueSimpleAlert } from 'vue-simple-alert'
Vue.use(VueSimpleAlert)
- Then, I added the specified lines within my
nuxt.config.js
:
plugins: [
{ src: "~/plugins/alert", mode:"client" }
],
After that, in my pages/text.vue
file, I inserted the alert message as instructed:
this.$alert("Hello Vue Simple Alert.");
However, instead of displaying as an alert message, the text appears as a regular paragraph on the Vue page.
https://i.sstatic.net/uvqtu.png
I'm puzzled as to what might be causing this issue, as I have successfully implemented other packages in a similar manner without any problems, but for some reason, it's not working correctly for vue-simple-alert
.