重庆分公司,新征程启航

为企业提供网站建设、域名注册、服务器等服务

怎么用vue+springboot+blob导出excel

本篇内容介绍了“怎么用vue+springboot+blob导出excel”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!

创新互联建站是一家专业从事成都做网站、成都网站建设的网络公司。作为专业网站设计公司,创新互联建站依托的技术实力、以及多年的网站运营经验,为您提供专业的成都网站建设、成都全网营销推广及网站设计开发服务!

1、vue中导出按钮方法中写法: this.$ajax({ method: 'POST', url: ${this.baseURL}/export, responseType: 'blob' }).then(res => { const blob = new Blob([res.data], { type: 'application/vnd.ms-excel' }) let fileName = 'Excel模板.xls' if ('download' in document.createElement('a')) { const elink = document.createElement('a') elink.download = fileName elink.style.display = 'none' elink.href = URL.createObjectURL(blob) document.body.appendChild(elink) elink.click() URL.revokeObjectURL(elink.href) // 释放URL 对象 document.body.removeChild(elink) } else { navigator.msSaveBlob(blob, fileName) } }) 2、后台利用poi导出,代码省略。。。

“怎么用vue+springboot+blob导出excel”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注创新互联网站,小编将为大家输出更多高质量的实用文章!


分享名称:怎么用vue+springboot+blob导出excel
网页地址:http://cqcxhl.cn/article/ggieso.html

其他资讯

在线咨询
服务热线
服务热线:028-86922220
TOP