当前位置:网站首页>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
边栏推荐
- LeetCode 542、01 矩阵
- Common form verification
- DNS cloud school | analysis of hidden tunnel attacks in the hidden corner of DNS
- Recommend an open source free drawing software draw IO exportable vector graph
- Commit and rollback in DCL of 16 MySQL
- Operation of numpy array
- Implementation of mypromise
- Automatically fill in body temperature and win10 task plan
- The second method of file upload in form form is implemented by fileitem class, servletfileupload class and diskfileitemfactory class.
- [PTA] get rid of singles
猜你喜欢

PIP installation package reports an error. Could not find a version that satisfies the requirement pymysql (from versions: none)

LeetCode 116. Populate the next right node pointer for each node

SQL Server Connectors By Thread Pool | DTSQLServerTP plugin instructions

A login and exit component based on token

The construction and use of Fortress machine and springboard machine jumpserver are detailed in pictures and texts

How to protect ECs from hacker attacks?

堡垒机、跳板机JumpServer的搭建,以及使用,图文详细

Building the tide, building the foundation and winning the future -- the successful holding of zdns Partner Conference

Numpy Index & slice & iteration

Leetcode 74. Search two-dimensional matrix
随机推荐
Customize timeline component styles
How can matlab obtain the truncated image in trainingimagelabeler
How to configure SSH public key in code cloud
Modeling based on catiav6
Leetcode 994, rotten orange
Building the tide, building the foundation and winning the future -- the successful holding of zdns Partner Conference
Common form verification
【PTA】L1-002 打印沙漏
Browser - learning notes
Recommend an open source free drawing software draw IO exportable vector graph
上海回應“面粉官網是非法網站”:疏於運維被“黑”,警方已立案
A login and exit component based on token
Experience of mathematical modeling in 18 year research competition
Why does ES6 need to introduce map when JS already has object type
Mathematical modeling column | Part 5: MATLAB optimization model solving method (Part I): Standard Model
Three. Based on ply format point cloud voxel model JS upload interface writing
Some basic configurations in interlij idea
堡垒机、跳板机JumpServer的搭建,以及使用,图文详细
The flinkcdc reports an error: but this is no longer available on the server
XXXI` Prototype ` displays prototype properties and`__ proto__` Implicit prototype properties