当前位置:网站首页>Nprogress plug-in progress bar
Nprogress plug-in progress bar
2022-07-05 20:29:00 【Cheng_ eighty-eight】
One 、 Installation dependency
npm install nprogress -S
Two 、 Introduce progress bar NProgress And corresponding styles (request.js In file )
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
3、 ... and 、 Use
// Request interceptor
instance.interceptors.request.use(
config => {
// stay request In the interceptor , Show the progress bar NProgress.start()
NProgress.start()
if (sessionStorage.getItem('token')) {
config.headers.Authorization = sessionStorage.getItem('token')
}
return config
},
err => {
return Promise.reject(err)
}
)
// Response interceptors
instance.interceptors.response.use(
res => {
// stay response In the interceptor , Hide progress bar NProgress.done()
NProgress.done()
if (res.status === 200) {
return Promise.resolve(res.data)
} else {
return Promise.reject(res)
}
},
err => {
return Promise.reject(err)
}
)
边栏推荐
- document方法
- 物联网智能家居基本方法实现之经典
- Oracle tablespace management
- Leetcode brush question: binary tree 14 (sum of left leaves)
- [quick start to digital IC Verification] 8. Typical circuits in digital ICs and their corresponding Verilog description methods
- 2022年7月4日-2022年7月10日(ue4视频教程mysql)
- 本季度干货导航 | 2022年Q2
- How to retrieve the root password of MySQL if you forget it
- Leetcode skimming: binary tree 10 (number of nodes of a complete binary tree)
- IC科普文:ECO的那些事儿
猜你喜欢
![[quick start of Digital IC Verification] 7. Basic knowledge of digital circuits necessary for verification positions (including common interview questions)](/img/90/aad9d7900d686efca10140717a5c5c.png)
[quick start of Digital IC Verification] 7. Basic knowledge of digital circuits necessary for verification positions (including common interview questions)

Wechat applet regular expression extraction link

Solve the problem that the database configuration information under the ThinkPHP framework application directory is still connected by default after modification

【数字IC验证快速入门】9、Verilog RTL设计必会的有限状态机(FSM)

【愚公系列】2022年7月 Go教学课程 004-Go代码注释

小程序事件绑定

2.8 basic knowledge of project management process

小程序页面导航

CVPR 2022 | 常见3D损坏和数据增强

14、Transformer--VIT TNT BETR
随机推荐
JS implementation prohibits web page zooming (ctrl+ mouse, +, - zooming effective pro test)
CTF逆向基础
【数字IC验证快速入门】6、Questasim 快速上手使用(以全加器设计与验证为例)
C langue OJ obtenir PE, ACM démarrer OJ
小程序项目结构
【数字IC验证快速入门】8、数字IC中的典型电路及其对应的Verilog描述方法
[quick start of Digital IC Verification] 3. Introduction to the whole process of Digital IC Design
y57.第三章 Kubernetes从入门到精通 -- 业务镜像版本升级及回滚(三十)
Informatics Olympiad 1338: [example 3-3] hospital setting | Luogu p1364 hospital setting
Station B up builds the world's first pure red stone neural network, pornographic detection based on deep learning action recognition, Chen Tianqi's course progress of machine science compilation MLC,
sun. misc. Base64encoder error reporting solution [easy to understand]
基础篇——配置文件解析
Classic implementation method of Hongmeng system controlling LED
National Eye Care Education Conference, 2022 the Fourth Beijing International Youth eye health industry exhibition
Classic implementation of the basic method of intelligent home of Internet of things
关于BRAM IP复位的优先级
How to select the Block Editor? Impression notes verse, notation, flowus
Mongodb/ document operation
【愚公系列】2022年7月 Go教学课程 004-Go代码注释
信息学奥赛一本通 1339:【例3-4】求后序遍历 | 洛谷 P1827 [USACO3.4] 美国血统 American Heritage