正在學習Vuex,今天對照了文檔中的實例寫了一下,發現無法完成文檔中的功能,并報錯[vuex] unknown action type: INCREMENT示例代碼如下:import Vue from 'vue';
import Vuex from 'vuex';
Vue.use(Vuex)
const store = new Vuex.Store({ state: {
count: 0
},
mutations: {
INCREMENT (state) {
// 改變 state
state.count++
}
}
})
store.dispatch('INCREMENT');
console.log(store.state.count)google了一下沒有發現這方面的信息,所以想請問一下,有沒有人遇到過這樣的情況,以及解決辦法是怎樣的
Vuex 在使用 Mutation handler 顯示unknown action type:
12345678_0001
2018-09-12 10:10:59