// 添加预览的盒子
<div class="pdfDiv"><div/>
//引入插件
import PDFObject from "pdfobject"
async showDialog(row){
let params = {
path: row.topdf,
fileName: row.fileName
}
try{
const res = await downLoad(params)// 获取文件流
let testurl = URL.create0bjectURL(new Blob([res],{ type:‘application/pdf' }))
PDFObject.embed(testurl,'.pdfDiv',{
pdfopenParams:{
// view: "Fitv",
pagemode: "thumbs",// 调整展示页面的模式
zoom:"150%", // 设置文档大小的缩放
}
} catch (err) {
this.$message.warhing('文件预览失败,请再试一次!')
}
}