请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

命名问题,interface 和 class 同时叫 AxiosError

一般会这样做吗?

我如果想同时倒出到库外面,怎么办

比如这样用:

axios({
  method: 'get',
  url: '/error/timeout',
  timeout: 2000
}).then((res) => {
  console.log(res)
}).catch((e) => {
  if (e instanceof AxiosError) {
    console.log(e)
    console.log(e.isAxiosError)
  }
})


正在回答

1回答

不能用 instanceof AxiosError 的接口
参考 https://stackoverflow.com/questions/14425568/interface-type-check-with-typescript

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号