【Web前端问题】axios回调
成功访问后的回调函数是什么

回答:
axios({params},config).then(response=>{    console.log(response);
}).catch(err=>{
    console.log(err);
});
回答:
axios.post('/user', {    firstName: 'Fred',
    lastName: 'Flintstone'
  })
  .then(function (response) {
    console.log(response);
  })
  .catch(function (error) {
    console.log(error);
  });
在then里面写回调逻辑
回答:
.then(function (response) {                //这里是处理正确的回调
                let res = response.data.data;
                e.lists = res;
                console.log(res)
                })
                .catch(function (error) {
                // 这里是处理错误的回调
                console.log(error);
            });
以上是 【Web前端问题】axios回调 的全部内容, 来源链接: utcz.com/a/136610.html
