get请求
<el
-button @click
="domLoad()">导出
</el
-button
>
domLoad() {
this.$axios({
method
: "get",
url
: "url",
responseType
: "blob"
}).then(res
=> {
let blob
= new Blob([res
.data
], { type
: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" })
let new_url
= window
.URL.createObjectURL(blob
);
window
.location
.href
= new_url
;
});
}
type类型参考:https://blog.csdn.net/xiaoranzhizhu/article/details/70473734
转载请注明原文地址:https://ipadbbs.8miu.com/read-47114.html