定义了一个vue的全局方法,但是可以在组件中调用,确不能再vuex中调用,提示undefined
Vue.prototype.ajax = function (){
alert('aaaaaaa');
};
var store = new Vuex.Store({
state: {
user: {},
},
actions: {
signout: function(context) {
this.ajax();
//undefined
}
}
});
精慕HU
慕村225694
繁花不似锦
随时随地看视频慕课网APP