start :进度条开始
done :进度条结束
进度条样式可以改,当然需要修改人家的样式
import axios from 'axios' //引入进度条 //start 进度条开始 done 进度条结束 import nprogress from 'nprogress' //引入进度条样式 import "nprogress/nprogress.css" const instance = axios.create({ baseURL:'/api', timeout:5000 }) instance.interceptors.request.use(config=>{ nprogress.start() return config }) instance.interceptors.response.use(res=>{ nprogress.done() return res.data })
标签:instance,axios,进度条,start,done,使用,nprogress From: https://www.cnblogs.com/czwhandsome/p/16779235.html