компонент
computed: {
score () {
this.$store.commit('geolocation');
console.log(this.$store.getters.lat);
}
}
store.js
export default {
state: {
lat:'ok',
},
getters:{
cordinate(state){
return state.lat
}
},
mutations: {
geolocation(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,
})
Впервые на vuex.Пытался получить значение от Vuex.но застрял на этой ошибке: [vuex] неизвестный тип мутации.я что-то упустил?