cannot read property ‘dispatch’ of undefined in Vuex

That’s because you probably didn’t add store option to the root instance of Vue. By providing it you will be able to access store from all of root’s child components. Therefore your root instance should look like this:

import store from './store'

const app = new Vue({
  /* .. other properties .. */
  store
})

Now you can freely use this.$store within your components.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)