一直出现router使用不能识别,在axios中使用js路由我用的是functionphp
axios.get('/user', { params: { ID: 12345 } }) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); });
而后打印出this,出现undefined,没有this对象,将function改变箭头函数ios
axios.get('/user', { params: { ID: 12345 } }) .then((response) => { console.log(response); }) .catch((error) => { console.log(error); });
this对象就出来了web