if-pdf-viewer
v1.0.3
Published
PDFJS预览插件,适用于vue2/3
Downloads
3
Readme
如何使用
npm install if-pdf-viewer
// template
<if-pdf-viewer :file="file" />
//js
import { IfPdfViewer } from 'if-pdf-viewer'
Blob使用
import axios from 'axios'
import {ref} from 'vue'
const file = ref(null)
const getBlobHandler = () => {
return axios.get('http://blobURL', {
responseType: 'blob',
headers: {
Authorization: 'Bearer XXXXXXXXXX'
}
})
}
let $ = getBlobHandler()
$.then(res => {
// vue2 : this.file
file.value = window.URL.createObjectURL(new Blob([res.data], { type: "application/pdf" }));
})
Features
- 下载功能 Download Support