Vue downloads excel and other files and realizes the download progress

problem description

to implement the file download function, you can put the resource url into the a tag, but how to achieve the real-time progress of downloading (for example, a total of 800kb, 321kb downloaded in this second)?

looked up some materials do not seem to understand, trouble to know the god to give a train of thought! I can"t thank you enough.

part of the UI diagram is as follows

May.25,2021

xhr.onreadystatechange achieves upload progress in this callback


which request library are you using?
if there are parameters of download progress in the axios, official document


have you solved this problem? I have also encountered the problem of how to display the download progress bar for download url, in the background

.
Menu