导出pdf打不开解决

This commit is contained in:
86182
2022-10-18 11:53:02 +08:00
parent 0ab25da6ba
commit f6111c056b

View File

@@ -301,7 +301,7 @@ export default {
} else {
const link = document.createElement('a');// 创建a标签
// let blob = new Blob([res],{type: 'application/vnd.ms-pdf;charset=UTF-8'}); // 设置文件类型
let blob = new Blob([res],{type: 'application/pdf;charset=UTF-8'}); // 设置文件类型
let blob = new Blob([res],{type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'}); // 设置文件类型
link.style.display = "none";
link.href = URL.createObjectURL(blob); // 创建URL
link.setAttribute("download", "我的笔记.pdf");