当前位置:网站首页>Easy to use nprogress progress bar
Easy to use nprogress progress bar
2022-04-23 20:31:00 【Different 213】
First step : install NProgress
$ npm install --save nprogress
The second step : stay main.js
Import in file NProgress
The package corresponds to JS and CSS
// Import NProgress The package corresponds to JS and CSS
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
The third step : Use in interceptor NProgress.start()
and NProgress.done()
// axios Request to intercept
// stay request In the interceptor , Show the progress bar NProgress.start()
axios.interceptors.request.use(config => {
// console.log(config)
NProgress.start()
config.headers.Authorization = window.sessionStorage.getItem('token')
// In the end must return config
return config
})
// stay response In the interceptor , Hide progress bar NProgress.done()
axios.interceptors.response.use(config => {
// console.log(config)
NProgress.done()
// In the end must return config
return config
})
版权声明
本文为[Different 213]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210550450746.html
边栏推荐
- Three. Based on ply format point cloud voxel model JS upload interface writing
- bounding box iou
- LeetCode 74、搜索二维矩阵
- Es keyword sorting error reason = fielddata is disabled on text fields by default Set fielddata = true on keyword in order
- Implementation of mypromise
- Error reported by Azkaban: Azkaban jobExecutor. utils. process. ProcessFailureException: Process exited with code 64
- 【栈和队列专题】—— 滑动窗口
- Browser - learning notes
- Azkaban recompile, solve: could not connect to SMTP host: SMTP 163.com, port: 465 [January 10, 2022]
- Shanghai responded that "flour official website is an illegal website": neglect of operation and maintenance has been "hacked", and the police have filed a case
猜你喜欢
Mathematical modeling column | Part 5: MATLAB optimization model solving method (Part I): Standard Model
高薪程序员&面试题精讲系列91之Limit 20000加载很慢怎么解决?如何定位慢SQL?
SQL Server connectors by thread pool 𞓜 instructions for dtsqlservertp plug-in
The construction and use of Fortress machine and springboard machine jumpserver are detailed in pictures and texts
Click an EL checkbox to select all questions
Latest investigation and progress of building intelligence based on sati
內網滲透之DOS命令
Identification of bolt points in aerial photography based on perception
Tensorflow 2 basic operation dictionary
【栈和队列专题】—— 滑动窗口
随机推荐
Leetcode 994, rotten orange
LeetCode 232、用栈实现队列
【栈和队列专题】—— 滑动窗口
. Ren -- the intimate artifact in the field of vertical Recruitment!
Leetcode 1337. Row K with the weakest combat effectiveness in the matrix
Error reported by Azkaban: Azkaban jobExecutor. utils. process. ProcessFailureException: Process exited with code 64
A useless confession artifact
PIP installation package reports an error. Could not find a version that satisfies the requirement pymysql (from versions: none)
LeetCode 116. 填充每个节点的下一个右侧节点指针
Research on open source OCR engine
Modeling based on catiav6
Rédaction de thèses 19: différences entre les thèses de conférence et les thèses périodiques
I JS deep copy and shallow copy
【PTA】L1-002 打印沙漏
高薪程序员&面试题精讲系列91之Limit 20000加载很慢怎么解决?如何定位慢SQL?
Markdown < a > tag new page open link
Some basic configurations in interlij idea
上海回應“面粉官網是非法網站”:疏於運維被“黑”,警方已立案
Mysql database backup scheme
黑客的入侵方式你知道几种?