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 integration method #41

Open
alexander-girsh opened this issue Sep 16, 2018 · 3 comments
Open

Vuex integration method #41

alexander-girsh opened this issue Sep 16, 2018 · 3 comments

Comments

@alexander-girsh
Copy link

Hi there,
this plugin is comfy (thank you, mr. Alfhen) , but if you want to incapsulate smth in vuex store (for example the choice between cookie and local storage), you may have an issue: from-the-box vuex doesn't know about this.$cookie or vm.$cookie.

All u need is just reinitialize that. Look on the pictures.
vuex store
app call

@MauricioHernanCabrera
Copy link

I had the same problem

@ezra-obiwale
Copy link

ezra-obiwale commented Dec 12, 2018

@noguilty4you @MauricioHernanCabrera Another option is to just use vue.prototype.$cookie directly.

import vue from 'vue'

async someAction ({ commit }) {
  // Do something
  vue.prototype.$cookie.set(key, value)
}

@alexander-girsh
Copy link
Author

@noguilty4you @MauricioHernanCabrera Another option is to just use vue.prototype.$cookie directly.

import vue from 'vue'

async someAction ({ commit }) {
  // Do something
  vue.prototype.$cookie.set(key, value)
}

thanks, vue.prototype is interesting syntax

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