You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
how to do this in .js files? e.g I have api.js and when the API call returns error, I want to show the notification.
Tried these but it doesn't work
import Vue from 'vue'
// some API call
Vue.prototype.$notify({message: 'some error', type: 'danger'})
/* Cannot read property 'notify' of undefined */
import Vue from 'vue'
import Notify from 'vue-notifyjs'
import '@/assets/css/themify-icons.css'
import 'vue-notifyjs/themes/default.css'
// some API call
Notify({message: 'some error', type: 'danger'})
/* vue_notifyjs__WEBPACK_IMPORTED_MODULE_2___default(...) is not a function */
Also I'm thinking of putting the initialization in a single js file (notification.js), which then imported to main.js
From the readme, to show the notification we can use
how to do this in .js files? e.g I have api.js and when the API call returns error, I want to show the notification.
Tried these but it doesn't work
Also I'm thinking of putting the initialization in a single js file (notification.js), which then imported to main.js
So that in the template I can just call
this.$notif.success("message")
or in the Vuex modules / api.js
Vue.prototype.$notif.error(error.response.data)
The text was updated successfully, but these errors were encountered: