想通过引入CDN的方式来加载Vuex,优化首屏加载时间,但是把script标签放到了vue的下面,然后再webpack.base.conf.js的externals中也加了'vuex':'Vuex',然后新建一个index.js文件,
var store = new Vuex.store({
state: {
msg:'hello world'
},
mutations: {
updata(state) {
state.msg = '111';
}
}
})
export default store;
然后一直报错
new Vuex.Store,大小写写错了,哈哈