just installed sweetalert2 as my primary alert system, as per the docs https://sweetalert2.github.io/#download i have npm installed it and added these for configuration on my main app.js file
require('./bootstrap');
window.Vue = require('vue');
import VModal from 'vue-js-modal'
const swal = require('sweetalert2') // added here
Vue.use(VModal)
also i created a function to show alerts like this
alertSuccess : function(msg){
const toast = swal.mixin({
toast: true,
position: 'bottom-start',
showConfirmButton: false,
timer: 3000,
});
toast({
type: 'success',
title: msg,
})
},
unfortunately, chrome is showing this error on devTools
Uncaught ReferenceError: swal is not defined
What seems to be the problem ?