axiox下载文件

 axios.request({ url: url, method: method, responseType: 'blob' })
                .then(response => {
                    let data = response.data;
                    let blob = new Blob([data], { type: "" }),
                        objectURL = URL.createObjectURL(blob),
                        $a = document.createElement("a");
                    blob.lastModifiedDate = new Date();

                    $a.setAttribute("href", objectURL);
                    $a.setAttribute("download", this.table.currentRow.name);
                    $a.click();
                    $a = null;
                })
原文地址:https://www.cnblogs.com/shenjichenai/p/12160835.html