可以使用 Interceptors 拿 loading 来讲,代码大概长这样: axios.interceptors.request.use(function (config) { // 开启 loading startLoading() return config }); axios.interceptors.response.use(function (response) { // 关闭 loading endLoading() return response })
可以使用 Interceptors
拿 loading 来讲,代码大概长这样: