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

Use of this.$store API does not initiate when used with vue-router #56

Closed
blake-newman opened this issue Feb 16, 2016 · 3 comments
Closed

Comments

@blake-newman
Copy link
Member

The use of the this.$store is not available when using Vuex and vue-router. This may be an issue with vue-router rather than Vuex.

@blake-newman
Copy link
Member Author

import Vue from 'vue';
import VueRouter from 'vue-router';
import VueResource from 'vue-resource';
import store from 'Store';

// Install plugins
Vue.use(VueRouter);
Vue.use(VueResource);

const app = {
  store,
  data() {
    console.log(this.$store); // not defined
    return {};
  },
};

// Create router
const router = new VueRouter({});

// Map router
router.map( /* mapping */ );
// Start router
router.start(app, 'html');

@yyx990803
Copy link
Member

This is known issue in 0.3.0. Will be fixed in the next release.

@wuno
Copy link

wuno commented Sep 21, 2018

I am getting this exact problem. Is there any reason this would be an issue again?

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