Open pirmax opened 6 years ago
It would be great if we can use notifications how it realized in element ui for example:
import { Message } from 'element-ui'; actions: { showSuccessMessage (options) { Message.success(options) } }
Have you tried accessing $snotify directly from Vue? It's a little hacky but should work.
actions: {
async errorHandler (error) {
Vue.prototype.$snotify.error(error)
// and if multiple errors, then while on error
}
}
Hi! I don't know if you still need help, you've probably already solved it, but this might help somebody: this._vm.$snotify.error(error)
Originally posted by @serkandemirel0420 in https://github.com/vuejs/vuex/issues/1399#issuecomment-449972993
I use VueJS 2, VueX, NuxtJS and Vue-Snotify for flash notifications.
It may not be the correct use of VueX, but I'd like to dispatch the errors caught in a try/catch.
Then the dispatch, with VueX should display the notifications with Snotify-View with a loop if there are several errors.
What do you think and how to recover the instance of $snotify in VueX?