[Vuejs]-How to solve error : [vuex] unknown action type: (method)

3👍

You are using namespaced modules, so try like:

this.$store.dispatch('countries/getCountries');

and call your geter like:

computed: {
  getData() {
    return this.$store.getters['countries/getCountries']
  }
}

0👍

Store.js

import countries from "./modules/countries "

Vue.use(Vuex);

export const store = new Vuex.Store({     
    modules : {
        countries
    }
});
👤Serap

Leave a comment