Closed dbettin closed 6 years ago
@dbettin unfortunately it's not possible to call it from vuex at the moment because it's tied to the local vue instance. It could possibly be modified to allow that similar to http://element.eleme.io/#/en-US/component/notification but I'll have to look into that
👍
Hi @dbettin @ligne13
Released a new version which should make this possible
You can now do this
import {Notification} from 'vue-notifyjs'
Notification.notify({type: 'danger', message: 'My message'})
https://codesandbox.io/s/n7jvkz21y0
More details here https://github.com/cristijora/vue-notifyjs/releases
PS: You need to initialize the plugin anyway if you want to use this feature.
This should allow using the Notification
inside vuex modules/store since it's not tied to component instances in this case.
Is there a best practice for using this lib from Vuex? I am trying to understand how to call
this.$notify
for any notification that happens within the app.