Vue Component
computed: {
score () {
this.$store.commit('fetchCoordinates');
console.log(this.$store.getters.cordinate);
}
}
store.js
export default {
state: {
lat:'ok',
},
getters:{
cordinate(state){
return state.lat
}
},
mutations: {
fetchCoordinates(state){
state.lat
}
},
actions: {
}
}
App.js
import StoreData from'./store.js';
Vue.use(Vuex);
const store = new Vuex.Store({StoreData});
new Vue({
el: '#app',
data: {},
router: router,
store,
})
New to using Vuex. I attempted to retrieve a value from Vuex but encountered an error message stating "[vuex] unknown mutation type". Could someone please help me identify what I may be missing?