if-pdf-viewer

1.0.3 • Public • Published

如何使用

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

Readme

Keywords

Package Sidebar

Install

npm i if-pdf-viewer

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

109 kB

Total Files

58

Last publish

Collaborators

  • alibob