Skip to content

Vuex usage and passing global message options #24

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

Open
toudidel opened this issue Jan 4, 2019 · 1 comment
Open

Vuex usage and passing global message options #24

toudidel opened this issue Jan 4, 2019 · 1 comment

Comments

@toudidel
Copy link

toudidel commented Jan 4, 2019

When I call function flash() from Vuex it works but it doesn't apply global options like

Vue.use(VueFlashMessage, {
  messageOptions: {
    timeout: 1000,
  }
});

Calling it from Vuex does also support passing global options?

@ultrono
Copy link

ultrono commented Apr 24, 2021

Yep, same here. The options unfortunately only appear to be respected calling this.flash() from a Vue component, not a Vuex store.

EDIT: ignore that. You can only call this.flash() from Vue components. You need to call the following from your Vuex store:

Vue.prototype.$flashStorage.flash('message content', 'success', { timeout: 1000 })

Basically, without the messagesOptions key.

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

2 participants