在使用vuex的时候一直报这个错: Error in created hook: "TypeError: Cannot read property 'commit' of undefined"
检查了一遍发现原来没有在main.js引入全局store
import store from 'store/store.js'
const app = new Vue({ ...App, store })
在使用vuex的时候一直报这个错: Error in created hook: "TypeError: Cannot read property 'commit' of undefined"
检查了一遍发现原来没有在main.js引入全局store
import store from 'store/store.js'
const app = new Vue({ ...App, store })