vue-flash-message
vue-flash-message copied to clipboard
Vuex usage and passing global message options
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?
~~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.