当前位置:网站首页>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
边栏推荐
- Handwritten Google's first generation distributed computing framework MapReduce
- LeetCode 116. Populate the next right node pointer for each node
- How to configure SSH public key in code cloud
- LeetCode 20、有效的括号
- Zdns was invited to attend the annual conference of Tencent cloud basic resources and share the 2020 domain name industry development report
- . Ren -- the intimate artifact in the field of vertical Recruitment!
- Three. Based on ply format point cloud voxel model JS upload interface writing
- GO語言開發天天生鮮項目第三天 案例-新聞發布系統二
- Linux64Bit下安装MySQL5.6-不能修改root密码
- Scrapy教程 - (2)寫一個簡單爬蟲
猜你喜欢
[stack and queue topics] - sliding window
RT-1052学习笔记 - GPIO架构分析
內網滲透之DOS命令
Development of Matlab GUI bridge auxiliary Designer (functional introduction)
Tensorflow 2 basic operation dictionary
Installation and use of NVM
Devaxpress report replay: complete the drawing of conventional two-dimensional report + histogram + pie chart
SQL Server Connectors By Thread Pool | DTSQLServerTP 插件使用说明
Install MySQL 5.0 under Linux 64bit 6 - the root password cannot be modified
Numpy - creation of data type and array
随机推荐
Numpy - creation of data type and array
star
Thirty What are VM and VC?
[PTA] get rid of singles
【PTA】L2-011 玩转二叉树
Identification of bolt points in aerial photography based on perception
[latex] 5 how to quickly write out the latex formula corresponding to the formula
Modeling based on catiav6
LeetCode 232、用栈实现队列
An error is reported in the initialization metadata of the dolphin scheduler -- it turns out that there is a special symbol in the password. "$“
Error reported by Azkaban: Azkaban jobExecutor. utils. process. ProcessFailureException: Process exited with code 64
DOS command of Intranet penetration
論文寫作 19: 會議論文與期刊論文的區別
Recognition of high-speed road signs by Matlab using alexnet
Plato Farm元宇宙IEO上线四大,链上交易颇高
Browser - learning notes
Es keyword sorting error reason = fielddata is disabled on text fields by default Set fielddata = true on keyword in order
Servlet learning notes
Parsing methods of JSON data in C - jar and jobobject: error reading jar from jsonreader Current JsonReader item
Numpy sort search count set