从文件流获取pdf地址,展示pdf内容
界面:
<iframe :src="fileUrl" width="100%" height="500px"></iframe>
方法:
request({
url: '',
method: 'post',
data:param,
responseType:'blob'
}).then((res) => {
let blob = new Blob([res], {
type: `application/pdf;charset-UTF-8`,
});
this.fileUrl = URL.createObjectURL(blob);
});