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