Nativescript-vue: Vuex ???

Created on 4 Sep 2017  路  3Comments  路  Source: nativescript-vue/nativescript-vue

Does it have a support for Vuex and how do you implement it, Im running into errors when Im trying to implment it ????

Most helpful comment

It doesn't work the normal way. However this was how I got it to work:

Use Vuex:

Vue.use(Vuex)

import your store:

const store = require('./path/to/store.js');

And the just before creating your Vue instance:

Vue.prototype.$store = store

This makes your Vuex store available anywhere usin this.$store in your components.

Hope this helps.

All 3 comments

Hey, it should be working, but I have yet to try it. Can you describe the issues you are facing?

It doesn't work the normal way. However this was how I got it to work:

Use Vuex:

Vue.use(Vuex)

import your store:

const store = require('./path/to/store.js');

And the just before creating your Vue instance:

Vue.prototype.$store = store

This makes your Vuex store available anywhere usin this.$store in your components.

Hope this helps.

I just tested this with the latest version, and it seems like the workaround is no longer necessary.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tralves picture tralves  路  4Comments

rigor789 picture rigor789  路  6Comments

kjlaw89 picture kjlaw89  路  3Comments

zzhenryquezz picture zzhenryquezz  路  5Comments

justinbeatz picture justinbeatz  路  3Comments