注:ajax中加responseType: "blob"
if (res && res.status === 200) {
const filename = "对账表.xlsx";
const blob = new Blob([res.data]);
const link = document.createElement("a");
link.style.display = "none";
link.href = URL.createObjectURL(blob);
link.setAttribute("download", filename);
document.documentElement.appendChild(link);
link.click();
document.documentElement.removeChild(link);
} else {
let content = res.data; //arraybuffer类型数据
let resBlob = new Blob([content]);
let reader = new FileReader();
reader.readAsText(resBlob, "utf-8");
reader.onload = () => {
_this.$message.error(reader.result);
};
}
如何利用PHPExcel类库建php将数据格式转为excel
上面是“js后端返回的数据是blob类型的excel下载文件”的全面内容,想了解更多关于 js 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_2048.html
workflows工作流
一只黑色章鱼ComfyUI工作流
一个神秘的隐藏面孔下一本书的剪影ComfyUI工作流
一个黄色的海绵宝宝ComfyUI工作流
一个全脸彩绘和纹身的超级名模ComfyUI工作流
奇幻绘画风格:一只巨大蜗牛ComfyUI工作流
3D圆形玉雕图案comfyui工作流
树上站着一只鸟ComfyUI工作流
一个时间旅行女人的神秘剪影ComfyUI工作流
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

利用canvas画几个好玩的星云物种
在线生成金属文字
3d文字动画效果
canvas经线动画走到效果
利用js做一个炫酷音乐背景效果
如何利用svg做一个有趣的loading动画加载
Bootstrap可视化拖放布局







