Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vuex Notification Handling #24

Closed
dbettin opened this issue Mar 3, 2018 · 3 comments
Closed

Vuex Notification Handling #24

dbettin opened this issue Mar 3, 2018 · 3 comments

Comments

@dbettin
Copy link

dbettin commented Mar 3, 2018

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.

@cristijora
Copy link
Collaborator

@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

@ligne13
Copy link

ligne13 commented Apr 20, 2018

👍

cristijora added a commit that referenced this issue Apr 30, 2018
@cristijora
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants