Vue使用axios,then方法中无法读取到data中的数据,提示 Cannot set property 'xxx' of undefined
解决方法:
let self=this;
axios.get('/user', {
params: {
ID: 12345
}
})
.then(function (response) {
self.message = 'response.data'
console.log(response);
})
.catch(function (error) {
console.log(error);
});