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
You can use Vue eventBus.
Just create vue component errorHandler and in his created() method subscribe to global event. For Example "HANDLE_ERROR". And in your interceptor error handler function you emit event: Vue.$emit("HANDLE_ERROR", error)
Hey
I'm using vue-element-admin in my project. It has an util dir with request.js file in it to make http request easier:
There is a file (
main.js
) at the source root that import snotify and it works for the rest of the app.But I want to notify the user if the REST endpoint is down, this means I have to use snotify in request.js
I tried to use snotify importing Vue object:
but $snotify is undefined
I tried to create a js file (utils/notifier.js):
importing it in request.js, but with the same result
Could you please tell me how to do?
The text was updated successfully, but these errors were encountered: