
本文共 2377 字,大约阅读时间需要 7 分钟。
���������������������������������������������������������������������Excel������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������������������������
exportExcel() { // ���������������������������responseType���'arraybuffer' userApi.sensitiveDown(this.queryParam, {responseType: 'blob'}) .then(data => { // ���������������������Blob������ const blob = new Blob([data], {type: 'application/vnd.ms-excel'}); const link = document.createElement('a'); // ������������ link.style.display = 'none'; // ��������������������� URL link.href = URL.createObjectURL(blob); // ������������������������ link.download = '���������������.xlsx'; // ��������������������������� document.body.appendChild(link); // ������������������ link.click(); // ��������������������������� document.body.removeChild(link); });}
���������������������������������������������������������������������������
������userApi.sensitiveDown
���������������������������������������������'arraybuffer'
���������������������������������������������������
������������������������������������data
���������Blob
������������������������Excel���������������
������������<a>
������link
������������������link.style.display = 'none'
������������������������������������������������������������
������link.href
������������Excel���������URL���������������URL.createObjectURL(blob)
���Blob���������������������URL���
���������������������������'���������������.xlsx'
���
���������������������������������������������click()
������������������������������������������������������
���������������������������������������������������������������������������������
���������������������������������������
- ���������������������������������������������������������������������������������������������������������������
- ���������������������������������������������������������
- ������������������������������������������������������������
Blob
������������������������������������������
���������������������������������userApi.sensitiveDown
������������������������������������������������������
发表评论
最新留言
关于作者
