Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const config = {
- responseType:"json",
- onDownloadProgress: (progress) => {
- let length = progress.lengthComputable ? progress.total : progress.target.getResponseHeader('Content-Length') || progress.target.getResponseHeader('x-decompressed-content-length');
- if (length !== null) {
- this.progressBar(Math.round((progress.loaded * 100) / length));
- }
- }
- };
- axios.get('/myurl', config)
- .then(res => {
- // some code
- });
Add Comment
Please, Sign In to add comment